I have until now use bass.dll and want now use fmod ex. Some days ago I was able to play a mp3 with fmod, but today I can’t it. See somebody of you my mistake, because he say:
FMOD – Error
FMOD error! – Operation could not be performed because specified sound is not ready.
[code:2aemfk7o] TPlayer = class(TObject)
FSystem : Pointer;
FChannel1 : Pointer;
FChannel2 : Pointer;
FSound : Pointer;
FMOD_System_Init(FSystem, 2, FMOD_INIT_NORMAL, nil);
FMOD_System_SetStreamBufferSize(FSystem, 65536, FMOD_TIMEUNIT_RAWBYTES);
if FSound<> nil then FMOD_System_Release(FSound);
if FSystem <> nil then
if Playing then //Pause
if Node=nil then Node:=MainForm.PlayListVST.GetFirst;
FMOD_HARDWARE or FMOD_2D or FMOD_CREATESTREAM or FMOD_NONBLOCKING,
Return:=FMOD_System_PlaySound(FSystem, FMOD_CHANNEL_FREE, FSound, false, FChannel1);
if Return<>FMOD_OK then
Application.MessageBox(PAnsiChar(’FMOD error! – ‘ + FMOD_ErrorString(Return)), ‘FMOD – Error’, 16);
For me it is also mysterious, that this errormessage is not written in the unit fmoderrors.
- SunBlack asked 11 years ago
[quote="SunBlack":1o360xnn]thx, now it playing again :). But why it work with this parameter in the C#-Demo?[/quote:1o360xnn]Either dumb luck (perhaps the call takes long enough to allow it to succeed) or a slight difference between the C# demo and your code, most likely.
No, the file exists. I have test with the delphi debugger and my WMP 9 can play this url ;).
StrsFileName = 11;
StrsFileFolder = 12;
TMusicInfo = record
Strs: array[0..Strs ] of WideString;
Hmm, I think maybe there are some new issues with net streaming
In the c++ Netstream example:
FMOD_Channel_SetMute() is throwing a parameter error, commenting it out fixes it although obv now doesn’t mute if the buffer is starving.
Playsound is not accepting urls although it will accept a local path i.e.
http://myserveraddess/mytest.mp3 throws a ‘could not seek’ error
C:\mylocalserver\mytest.mp3 – plays fine …. it’s the same mp3 file.
So I didn’t get the same error as you although there definitely is a new issue there.
Delphi and VB throw the same error.
You’re opening the sound with the NONBLOCKING flag which means the open function will return immediately instead of waiting for the sound to finish loading. That means that when the playsound call executes the sound will not be guaranteed to have finished loading. The error message is telling you this.
Either take off the NONBLOCKING flag or put in code to wait until it is ready to play. (If you don’t want to spend the time to write some proper code to check the ready state, just try a Sleep(500) or something like that)
Please login first to submit.