Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
void setPspVolume(int volume)
{
	  pspAudioSetVolume(0, volume, volume);
	  pspAudioSetVolume(1, volume, volume);
	  pspAudioSetVolume(2, volume, volume);
	}