• 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
Why setting mData in render callback doesn't work, but memcpy does?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why setting mData in render callback doesn't work, but memcpy does?


  • Subject: Why setting mData in render callback doesn't work, but memcpy does?
  • From: Baoshan Sheng <email@hidden>
  • Date: Thu, 15 Dec 2016 02:39:35 +0800

In my audio output prototype, replace below line in the IOProc

memcpy(outOutputData->mBuffers[0].mData, pcm, outOutputData->mBuffers[0].mDataByteSize);

with

outOutputData->mBuffers[0].mData = pcm;

Will lead to digital silence. I have no idea why. The pcm buffer is globally alloced and never freed.

Does that means the caller of the IOProc expects the buffer be filled, rather than the pointer be replaced?

Any help would be appreciated.

 _______________________________________________
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: Why setting mData in render callback doesn't work, but memcpy does?
      • From: Brian Willoughby <email@hidden>
  • Prev by Date: ExtAudioFileWrite: insz - invalid number of frames? (iOS)
  • Next by Date: Re: ExtAudioFileWrite: insz - invalid number of frames? (iOS)
  • Previous by thread: Re: ExtAudioFileWrite: insz - invalid number of frames? (iOS)
  • Next by thread: Re: Why setting mData in render callback doesn't work, but memcpy does?
  • Index(es):
    • Date
    • Thread