• 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: [NEWBIE] Old thread and Vu-Meters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NEWBIE] Old thread and Vu-Meters


  • Subject: Re: [NEWBIE] Old thread and Vu-Meters
  • From: kelly jacklin <email@hidden>
  • Date: Tue, 9 Aug 2005 06:04:22 -0700

On Aug 9, 2005, at 3:54 AM, Sanri Parov wrote:

I'm new to this list and I was making my way to get a functional
Vu-meter using a NSProgressBar in my Cocoa application, when I went
stuck with CoreAudio.
CoreAudio is powerful but very complex.
In particular I have problems in comprehending the answer Kelly Jacklin
gave to Michael Hanna in the thread :


http://lists.apple.com/archives/coreaudio-api/2005/Feb/msg00021.html

In the same way as Michael Hanna I'm getting a lot of zeroes from the
NSLog and I can't figure why.
What is the way to use correctly SOUND_PRINTOUT_SIZE ?
Could you give me an hand?

I am not familiar with whatever code you are getting SOUND_PRINTOUT_SIZE from, but my reply to the original poster was using a count (SOUND_PRINTOUT_SIZE) as a _byte_ count for copying samples from a buffer, but then assuming that the resulting copied data would contain that same number of _samples_. Since samples are typically floats (depending on where your code lives), this resulted in (for the original poster) 1/4 the samples getting copies into the copy buffer, which is why he saw the first few sample values being correct, and subsequent ones being wrong (uninitialized or zero or whatever, depending on the previous contents of the buffer).


I have no idea what the problems you are encountering would be, but just be careful of assumptions that a sample count is the same as a memory size (as was the case for the original poster), as it only is for very unusual (nowadays) audio streams (namely 8-bit integer uncompressed)...

On a side note, I will be very surprised indeed if an NSProgressBar provides sufficiently responsive performance to implement a VU meter... You might take a gander at the MeterView class in the CarbonGenericView for tips on drawing meters that are reasonably responsive, although the end result is not exactly the most pleasing visual content in the world.

Hope this helps, and if not, please provide more specifics (like actual code snippets) to help direct further responses.

kelly

_______________________________________________
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: [NEWBIE] Old thread and Vu-Meters
      • From: Sanri Parov <email@hidden>
References: 
 >[NEWBIE] Old thread and Vu-Meters (From: Sanri Parov <email@hidden>)

  • Prev by Date: iTunes stuttering, and don't shoot me--it might involve Core Audio
  • Next by Date: Re: iTunes stuttering, and don't shoot me--it might involve Core Audio
  • Previous by thread: [NEWBIE] Old thread and Vu-Meters
  • Next by thread: Re: [NEWBIE] Old thread and Vu-Meters
  • Index(es):
    • Date
    • Thread