Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fw: How to use SoundComponentGetInfo ?



In my programme, I write like this :
 
//--------------------------------------------------------------------
 ComponentDescription cd = { kSoundOutputDeviceType, 0, 0, 0, 0 };
 Component c = FindNextComponent(0, &cd);
 if (c != NULL)
 {
  Handle myName;
  Handle myInfo;
  myName = NewHandleClear(128);
  myInfo = NewHandleClear(256);
  GetComponentInfo(c, &cd, myName, myInfo, nil);
  c = FindNextComponent(c, &cd);
 }
 
long value = 0;
 ComponentResult snderr;
 ComponentInstance ci = OpenComponent( c );
 
 snderr = SoundComponentGetInfo( ci, NULL, siChannelAvailable, &value);
 snderr = SoundComponentGetInfo( ci, NULL, siVolume, &value);
//----------------------------------------------------------------
 
The problem is :
 
The "GetComponentInfo(c, &cd, myName, myInfo, nil);" return correctly,
 
The "SoundComponentGetInfo( ci, NULL, siChannelAvailable, &value);" return correctly too,
 
But the "SoundComponentGetInfo( ci, NULL, siVolume, &value);" return err -2147450879(badComponentInstance).
 
I don't know that's why , maybe the soundID is incorrect, Could you tell me how to get the soundID -- the Second Param of SoundComponentGetInfo.
 
Thanks a lot.
 
 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.