2nd Post: Help: Sample accurate playhead positioning?
2nd Post: Help: Sample accurate playhead positioning?
- Subject: 2nd Post: Help: Sample accurate playhead positioning?
- From: "David M.Cotter" <email@hidden>
- Date: Mon, 3 Jan 2005 10:59:06 -0800
Please help! Anyone got any ideas here?
I've got an MP3 file I want to "skip around" in. Using CoreAudio
1) how do I "position the play head"? I tried just changing the
offset from which I read during the AudioConverterFillComplexBuffer()
callback, but then it returns paramErr
2) how do I position it accurately, or, rather, how do I then
determine how many uncompressed samples *would have* played had I not
skipped forward?
timestamps don't get pushed thru AudioConverterFillComplexBuffer(), so
there's no way to tell where in the file I should start reading.
works fine if you just go begin to end, but I need to skip around AND
know exactly where I land (either before or after the fact is fine)
please help, utterly stuck.
previous post
i'm using PlayAudioFileLite sample.
I want to adjust the position of the "play head" a-la iTunes.
I figured all I had to do was:
LERP() is just a "Linear Interpolate", i know that function works
progF = { some value between zero and one, indicating percentage of
total song }
i_audioPlayer->i_packetOffset = LERP(0,
i_audioPlayer->i_totalPacketCount, progF, 0.0, 1.0);
i_audioPlayer->i_byteOffset = i_audioPlayer->i_packetOffset *
i_audioPlayer->i_maxPacketSize;
but when I do that, then next time thru:
err = AudioConverterFillComplexBuffer(
i_convert_in_2_effect, CB_S_MP3_Decompress_InputProc,
inInputDataProcUserData, &inNumFrames,
ioData, outPacketDescription);
I get err = -50. that's a paramErr right? why??
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden