1 /*****************************************************************************
2 ** $Source: /cvsroot/bluemsx/blueMSX/Src/Linux/blueMSXlite/LinuxSound.c,v $
3 **
4 ** $Revision: 1.1 $
5 **
6 ** $Date: 2005/09/25 07:39:07 $
7 **
8 ** More info: http://www.bluemsx.com
9 **
10 ** Copyright (C) 2003-2004 Daniel Vikl, Tomas Karlsson
11 **
12 ** This software is provided 'as-is', without any express or implied
13 ** warranty. In no event will the authors be held liable for any damages
14 ** arising from the use of this software.
15 **
16 ** Permission is granted to anyone to use this software for any purpose,
17 ** including commercial applications, and to alter it and redistribute it
18 ** freely, subject to the following restrictions:
19 **
20 ** 1. The origin of this software must not be misrepresented; you must not
21 ** claim that you wrote the original software. If you use this software
22 ** in a product, an acknowledgment in the product documentation would be
23 ** appreciated but is not required.
24 ** 2. Altered source versions must be plainly marked as such, and must not be
25 ** misrepresented as being the original software.
26 ** 3. This notice may not be removed or altered from any source distribution.
27 **
28 ******************************************************************************
29 */
30 #include "ArchSound.h"
31 #include "libretro.h"
32
33 static retro_audio_sample_batch_t audio_batch_cb = NULL;
retro_set_audio_sample_batch(retro_audio_sample_batch_t cb)34 void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb) { audio_batch_cb = cb; }
35
soundWrite(void * dummy,Int16 * buffer,UInt32 count)36 static Int32 soundWrite(void* dummy, Int16 *buffer, UInt32 count)
37 {
38 if (audio_batch_cb)
39 audio_batch_cb(buffer, count / 2);
40 }
41
archSoundCreate(Mixer * mixer,UInt32 sampleRate,UInt32 bufferSize,Int16 channels)42 void archSoundCreate(Mixer* mixer, UInt32 sampleRate, UInt32 bufferSize, Int16 channels) {
43 mixerSetStereo(mixer, channels == 2);
44 mixerSetWriteCallback(mixer, soundWrite, NULL, 512);
45 }
46
archSoundDestroy(void)47 void archSoundDestroy(void) {}
archSoundResume(void)48 void archSoundResume(void) {}
archSoundSuspend(void)49 void archSoundSuspend(void) {}
50