I am using c#.net (if you know it in VB.Net you can still help)

I am loading mp3’s that are approx. 3-7 seconds, and when I use FSOUND_Stream_Play the mp3 is cut short by a couple of seconds. The sound quality is good.

When i load it as a sample, the quality drops and there are a lot of crackles.

Anyone else have this problem? How can I solve it?

Here is the code I am using:

private void playMP3Test(string passedRelativePath)
        string song = currentAppPath + passedRelativePath;
        OpenStream(song, (uint)Enums.FSOUND_MODES.FSOUND_MPEGACCURATE, 0, 0);
        FmodFunction.FSOUND_Stream_Play(0, _ptr);
        FmodFunction.FSOUND_SetVolume(0, 70);

    private void playMP3(string passedRelativePath)
        string song = currentAppPath + passedRelativePath;

        IntPtr ptr = new IntPtr(0);
        FmodFunction.FSOUND_Init(22050, 16, 0);

        byte[] filenames = Encoding.Default.GetBytes(song+'\0');
        GCHandle hfile = GCHandle.Alloc(filenames, GCHandleType.Pinned);
        IntPtr pfilename = (IntPtr)((int)hfile.AddrOfPinnedObject() + 4);

        ptr = FmodFunction.FSOUND_Sample_Load(-1, pfilename, (uint)Enums.FSOUND_MODES.FSOUND_NORMAL, 0, 0);
        FmodFunction.FSOUND_Sample_SetDefaults(ptr, -1, 30, -1 ,-1);

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.