// Enable / Disable sound void enablesound(int sound) { static int soundenabled = 0; if ((!soundenabled) && sound) { // Enable sound pspAudioSetChannelCallback(0, audiostreamcallback, NULL); } else if ((soundenabled) && !sound) { // Disable sound pspAudioSetChannelCallback(0, NULL, NULL); } soundenabled = sound; }
const char *MusicDriver_LibTimidity::Start(const char * const *param) { _midi.status = MIDI_STOPPED; _midi.song = NULL; if (mid_init(param == NULL ? NULL : const_cast<char *>(param[0])) < 0) { /* If init fails, it can be because no configuration was found. * If it was not forced via param, try to load it without a * configuration. Who knows that works. */ if (param != NULL || mid_init_no_config() < 0) { return "error initializing timidity"; } } DEBUG(driver, 1, "successfully initialised timidity"); _midi.options.rate = 44100; _midi.options.format = MID_AUDIO_S16LSB; _midi.options.channels = 2; #if defined(PSP) _midi.options.buffer_size = PSP_NUM_AUDIO_SAMPLES; #else _midi.options.buffer_size = _midi.options.rate; #endif #if defined(PSP) pspAudioInit(); pspAudioSetChannelCallback(_midi.options.channels, &AudioOutCallback, NULL); pspAudioSetVolume(_midi.options.channels, PSP_VOLUME_MAX, PSP_VOLUME_MAX); #endif /* PSP */ return NULL; }
void XMPLAY_Init(int channel) { filedataptr = 0; myChannel = channel; m_bPlaying = 0; pspAudioSetChannelCallback(myChannel, XMPlayCallback,0); }
void XMPLAY_End() { XMPLAY_Stop(); pspAudioSetChannelCallback(myChannel, 0,0); if (filedataptr != 0) { free(filedataptr); filedataptr = 0; } }
void OGG_Init(int channel){ initAudioLib(); MIN_PLAYING_SPEED=-10; MAX_PLAYING_SPEED=9; OGG_audio_channel = channel; OGG_milliSeconds = 0.0; OGG_tempmixleft = 0; memset(OGG_mixBuffer, 0, sizeof(OGG_mixBuffer)); pspAudioSetChannelCallback(OGG_audio_channel, oggDecodeThread, NULL); }
static BOOL PSP_Init(void) { if (VC_Init()) return 1; pspAudioInit(); pspAudioSetChannelCallback(0, (void *)sound_callback, NULL); return 0; }
int Init(int channel) { pspAudioInit(); // init the audio psp mad_stream_init(&stream); // create the mad variables, streams etc. mad_frame_init(&frame); mad_synth_init(&synth); mad_timer_reset(&timer); pspAudioSetChannelCallback(channel, fillOutputBuffer, 0); // set the callback to the function. mutex = sceKernelCreateSema("myMutexName", 0, 1, 1, 0); // create the mutex for threading secure. pausesong = 1; // set the variable to pause so no sound is played. started = 0; // the mp3 has not yet started. file = 0; // set the file to zero fileSize = 1; filePos = 0; printf("MusicEngine is initialized.\n"); return 1; };
void OGG_End(){ OGG_Stop(); pspAudioSetChannelCallback(OGG_audio_channel, 0,0); OGG_FreeTune(); endAudioLib(); }
void InitAudio() { pspAudioInit(); pspAudioSetChannelCallback(0, AudioCallback, NULL); }