Prepare the local audio device
| 117 | |
| 118 | // Prepare the local audio device |
| 119 | bool cSound_Amiga::devicePrepare() { |
| 120 | SDL_AudioSpec *desired; |
| 121 | |
| 122 | desired = new SDL_AudioSpec(); |
| 123 | mAudioSpec = new SDL_AudioSpec(); |
| 124 | |
| 125 | // FM Quality, 16Bit Signed, Mono |
| 126 | desired->freq=44100; |
| 127 | desired->format=AUDIO_S16LSB; |
| 128 | desired->channels=2; |
| 129 | |
| 130 | // 2048 Samples, at 2 bytes per sample |
| 131 | desired->samples=0x800; |
| 132 | |
| 133 | // Function to call when the audio playback buffer is empty |
| 134 | desired->callback = cSound_AudioCallback; |
| 135 | |
| 136 | // Pass a ptr to this class |
| 137 | desired->userdata = this; |
| 138 | |
| 139 | // Open the audio device |
| 140 | mVal = SDL_OpenAudioDevice(NULL, 0, desired, mAudioSpec, 0); |
| 141 | |
| 142 | delete desired; |
| 143 | |
| 144 | if(mVal < 0 ) { |
| 145 | std::cout << "Audio Device Initialization failed: " << SDL_GetError(); |
| 146 | std::cout << std::endl; |
| 147 | return false; |
| 148 | } |
| 149 | |
| 150 | return true; |
| 151 | } |
| 152 | |
| 153 | int16 cSound_Amiga::Track_Load( sSound* pSound, int16 pTrack, int16 pSong = -1) { |
| 154 | int16 Number = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected