• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 2nd Post: Help: Sample accurate playhead positioning?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2nd Post: Help: Sample accurate playhead positioning?


  • Subject: Re: 2nd Post: Help: Sample accurate playhead positioning?
  • From: Doug Wyatt <email@hidden>
  • Date: Mon, 3 Jan 2005 11:31:10 -0800

On Jan 3, 2005, at 10:59, David M.Cotter wrote:
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

Are you returning paramErr from your input proc? Is some call you are making there failing?


Or are you returning noErr from the input proc and getting a paramErr from AudioConverterFillComplexBuffer()?

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)

These questions can't be answered except in the context of the methods you're using for making a correlation between the audio device's hardware times and your playback timeline...


The timestamps tell you what the hardware is doing.

You are in control of what packets/frames you read and convert from the audio file, and where you place them on that timeline.

Doug


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
  • Follow-Ups:
    • Re: 2nd Post: Help: Sample accurate playhead positioning?
      • From: "David M. Cotter" <email@hidden>
References: 
 >2nd Post: Help: Sample accurate playhead positioning? (From: "David M.Cotter" <email@hidden>)

  • Prev by Date: Communication with Custom AudioUnit
  • Next by Date: Re: 2nd Post: Help: Sample accurate playhead positioning?
  • Previous by thread: 2nd Post: Help: Sample accurate playhead positioning?
  • Next by thread: Re: 2nd Post: Help: Sample accurate playhead positioning?
  • Index(es):
    • Date
    • Thread