bool decode_run( audio_chunk & p_chunk, abort_callback & p_abort ) { if (!loop && is_playing == 0) return false; int nbSample = 512; sample_buffer.grow_size( nbSample ); is_playing = ModPlug_Read(m_player, sample_buffer.get_ptr(), nbSample*2); p_chunk.set_data_fixedpoint( sample_buffer.get_ptr(), nbSample * 2, 44100, 2, 32, audio_chunk::channel_config_stereo ); return true; }
bool decode_run( audio_chunk & p_chunk, abort_callback & p_abort ) { if (!loop && m_info.musicTimeInMs == ymMusicGetPos(m_player)) return false; int nbSample = 500 / sizeof(ymsample); sample_buffer.grow_size( nbSample ); ymMusicCompute(m_player,sample_buffer.get_ptr(), nbSample); p_chunk.set_data_fixedpoint( sample_buffer.get_ptr(), nbSample * 2, 44100, 1, 16, audio_chunk::channel_config_mono ); return true; }
bool decode_run(audio_chunk & p_chunk,abort_callback & p_abort) { enum { deltaread = 1024, }; m_buffer.set_size(deltaread * raw_total_sample_width); t_size deltaread_done = m_file->read(m_buffer.get_ptr(),deltaread * raw_total_sample_width,p_abort) / raw_total_sample_width; if (deltaread_done == 0) return false;//EOF p_chunk.set_data_fixedpoint(m_buffer.get_ptr(),deltaread_done * raw_total_sample_width,raw_sample_rate,raw_channels,raw_bits_per_sample,audio_chunk::g_guess_channel_config(raw_channels)); //processed successfully, no EOF return true; }
bool decode_run(audio_chunk &p_chunk, abort_callback &p_abort) { int channels = ASAPInfo_GetChannels(ASAP_GetInfo(asap)); int buffered_bytes = BUFFERED_BLOCKS * channels * (BITS_PER_SAMPLE / 8); static BYTE buffer[BUFFERED_BLOCKS * 2 * (BITS_PER_SAMPLE / 8)]; buffered_bytes = ASAP_Generate(asap, buffer, buffered_bytes, BITS_PER_SAMPLE == 8 ? ASAPSampleFormat_U8 : ASAPSampleFormat_S16_L_E); if (buffered_bytes == 0) return false; p_chunk.set_data_fixedpoint(buffer, buffered_bytes, ASAP_SAMPLE_RATE, channels, BITS_PER_SAMPLE, channels == 2 ? audio_chunk::channel_config_stereo : audio_chunk::channel_config_mono); return true; }
bool decode_run(audio_chunk &p_chunk, abort_callback &p_abort) { int channels = module_info.channels; int buffered_bytes = BUFFERED_BLOCKS * channels * (BITS_PER_SAMPLE / 8); static #if BITS_PER_SAMPLE == 8 byte #else short #endif buffer[BUFFERED_BLOCKS * 2]; buffered_bytes = ASAP_Generate(&asap, buffer, buffered_bytes, (ASAP_SampleFormat) BITS_PER_SAMPLE); if (buffered_bytes == 0) return false; p_chunk.set_data_fixedpoint(buffer, buffered_bytes, ASAP_SAMPLE_RATE, channels, BITS_PER_SAMPLE, channels == 2 ? audio_chunk::channel_config_stereo : audio_chunk::channel_config_mono); return true; }