• 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
Sound volume in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sound volume in Cocoa


  • Subject: Sound volume in Cocoa
  • From: Ben Haller <email@hidden>
  • Date: Wed, 11 Dec 2002 22:21:31 -0800

Hi! I've got what seems like it ought to be a simple question, but I can't seem to find any answers anywhere in the doc or the archives.
I'm playing a sound with NSSound's -play method. All I want to do is set the volume that particular sound will be played at, relative to the overall system sound level. I am comfortable with changing the volume for all of the sounds I play, if the volume can't be set for each sound individually. I am not comfortable with changing the system volume; I don't want sounds in other apps to be affected.
I've got GetDefaultOutputVolume() getting the system volume for me. Calling SetDefaultOutputVolume() works, but it sets the volume for all running apps (which just seems like a bug to me, frankly -- I don't think my little app should be allowed to do that, at least without jumping through some hoops).
I'm willing to abandon NSSound and use QuickTime, Carbon, CoreAudio -- whatever it takes. I just need to read in a .aiff and play it with varying volume levels, that's all. But I don't know anything about those other system components, so actual example code that does something close to what I want would be much more useful than a "go read the QT docs" admonishment -- I have in fact tried to read the QT docs, but they are quite opaque, and I don't want to devote weeks of time to this, understandably. :->
Thanks!

Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Sound volume in Cocoa
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Re: Dynamic Services Menu
  • Next by Date: PDFOperationWithView
  • Previous by thread: Re: Coding norms
  • Next by thread: Re: Sound volume in Cocoa
  • Index(es):
    • Date
    • Thread