コード例 #1
0
ファイル: input_ym.cpp プロジェクト: Crazybond/foobar2000
	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;
	}
コード例 #2
0
ファイル: SmallYmPlayer.cpp プロジェクト: Kinglions/modizer
static	void	soundServerCallback(void *pBuffer,long size)
{

	if (s_pMusic)
	{
		int nbSample = size / sizeof(ymsample);
		ymMusicCompute((void*)s_pMusic,(ymsample*)pBuffer,nbSample);
	}
}
コード例 #3
0
ファイル: YMPlugin.cpp プロジェクト: EirikVea/mp-ym
// The plugin host calls this when it wants a new audio frame
DWORD YMPlugin::FillBuffer(void* pbuffer, DWORD length)
{
    short *src = new short[length<<1];
    short *dst = new short[length];

    if(ymMusicCompute(m_ymMusic,(ymsample*)src,length<<2))
    {
        for(DWORD i = 0, j = 0; i < length<<2; i++, j+=2)
        {
            dst[j] = src[i];
            dst[j + 1] = src[i];
        }

        memcpy(pbuffer,dst,length);
    }

    delete dst;
    delete src;

    return length;
}