0
0

Next example illustrates my problem. It skips 10 seconds forward or 10 seconds backward. When you run this program with v4.08.06 it works perfectly, when you use v4.08.09 the fast forward goes noticeably slower, and the fast backward takes ages.

Strange thing is, the problem only arises with MP3, with an OGG file there is no problem.

using WinXP SP2

[code:16srnt6m]

include <fmod.hpp>

include <stdlib.h>

include <stdio.h>

include <conio.h>

include <windows.h>

using namespace FMOD;

void main()
{
System *system;
System_Create(&system);
system->init(10, FMOD_INIT_NORMAL, 0);
Sound *sound;
system->createSound("E:\z.mp3", FMOD_2D | FMOD_SOFTWARE | FMOD_CREATESTREAM, 0, &sound);
unsigned int len;
sound->getLength(&len, FMOD_TIMEUNIT_MS);
Channel *channel;
system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);

printf(&quot;press f for forward, b for backward, q to quit\n&quot;);
char choise;
while ( true )
{
    unsigned int curpos = 0;
    if (kbhit())
    {
        choise = _getch();

        switch( choise )
        {
        case 'f':
            {
                for ( int i = 0; i &lt; 25; i++ )
                {
                    channel-&gt;getPosition( &amp;curpos, FMOD_TIMEUNIT_MS );
                    channel-&gt;setPosition( curpos + 400, FMOD_TIMEUNIT_MS);
                }
                break;
            }
        case 'b':
            {
                for ( int i = 0; i &lt; 25; i++ )
                {
                    channel-&gt;getPosition( &amp;curpos, FMOD_TIMEUNIT_MS );
                    channel-&gt;setPosition( curpos - 400, FMOD_TIMEUNIT_MS);
                }
                break;
            }
        case 'q':
            {
                return;
            }

        }
    }
    channel-&gt;getPosition( &amp;curpos, FMOD_TIMEUNIT_MS );
    printf( &quot;Position: %u      \r&quot;, curpos );
    Sleep(10);
}

}
[/code:16srnt6m]

regards,

Hans de Rijck

  • You must to post comments
0
0

what media are you streaming from? I dont see any problem like this even with your example program. Mp3 seeks forward and back and it is almost instantaneous.

  • You must to post comments
0
0

I’m streaming from a local sata HD.

To get some more information I added a timer around the SetPosition as follows:

[code:byy5a5xi]
SYSTEMTIME sTimeBefore, sTimeAfter;

                    GetSystemTime( &amp;sTimeBefore );
                    channel-&gt;setPosition( curpos - 400, FMOD_TIMEUNIT_MS);
                    GetSystemTime( &amp;sTimeAfter );
                    printf( &quot;Before: %2d.%03d  After: %2d.%03d\n&quot;, 
                        sTimeBefore.wSecond, 
                        sTimeBefore.wMilliseconds,
                        sTimeAfter.wSecond, 
                        sTimeAfter.wMilliseconds );

[/code:byy5a5xi]

This gives the following results:

[list:byy5a5xi]
Before: 13.638 After: 14.701
Before: 14.701 After: 15.811
Before: 15.811 After: 15.826
Before: 15.826 After: 15.842
Before: 15.842 After: 16.842
Before: 16.842 After: 17.873
Before: 17.873 After: 17.889
Before: 17.889 After: 17.889
Before: 17.889 After: 18.170
Before: 18.170 After: 19.139
Before: 19.139 After: 20.124
Before: 20.124 After: 20.124
Before: 20.124 After: 20.139
Before: 20.139 After: 21.030
Before: 21.030 After: 21.968
Before: 21.968 After: 21.968
Before: 21.968 After: 21.968
Before: 21.968 After: 22.796
Before: 22.796 After: 23.656
Before: 23.656 After: 23.656
Before: 23.656 After: 23.671
Before: 23.671 After: 24.421
Before: 24.421 After: 25.203
Before: 25.203 After: 25.218
Before: 25.218 After: 25.218[/list:u:byy5a5xi]

As you can see, some calls are instantaneous, while others take a full second.

For your information, when I use fmodex.dll v4.08.06 (and nothing else is changed) I get the following results:

[list:byy5a5xi]
Before: 26.062 After: 26.062
Before: 26.062 After: 26.078
Before: 26.078 After: 26.093
Before: 26.093 After: 26.093
Before: 26.093 After: 26.109
Before: 26.109 After: 26.109
Before: 26.109 After: 26.125
Before: 26.125 After: 26.125
Before: 26.125 After: 26.140
Before: 26.140 After: 26.140
Before: 26.140 After: 26.156
Before: 26.156 After: 26.156
Before: 26.156 After: 26.172
Before: 26.172 After: 26.172
Before: 26.172 After: 26.187
Before: 26.187 After: 26.187
Before: 26.187 After: 26.203
Before: 26.203 After: 26.203
Before: 26.203 After: 26.218
Before: 26.218 After: 26.218
Before: 26.218 After: 26.234
Before: 26.234 After: 26.234
Before: 26.234 After: 26.250
Before: 26.250 After: 26.250
Before: 26.250 After: 26.265[/list:u:byy5a5xi]

regards,

Hans de Rijck.

  • You must to post comments
0
0

FMOD calls dont take a full second normally, its possible it is actually to do with your mp3. There really is no reason for this, the mp3 codec code hasnt changed and I can’t think of much else.

Can you test different mp3 files to see if that is the difference

  • You must to post comments
0
0

Brett,

I tested several different MP3’s, VBR, CBR, large ones, small ones etc.
There are some differences between the files, some are better, some are worse (the longest time was about 2 seconds for a call).
It was no strict scientific research but if there is any correlation I would say that the bitrate of the file has the most effect (320kbps files are worse than 128kbps). Mind you, there was not one MP3 that works ok.

The 4.08.06 version has no problems with any of the files so I would guess that something did change after all.

I hope you can find something. In the meantime I will revert back to 4.08.06.

Perhaps someone else reading this forum can confirm whether or not this is a problem (the setPosition, not my reverting).

regards,

Hans de Rijck.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.