Fmod Error In Fsound_setvolume
Volume and Get Volume 0 0 I have no idea why this code doesn't work to set the volume of a channel: [code:1k0uwmoj] FMOD::Channel *soundChannel; FMOD::System * tempSystem; result = tempSystem->playSound(FMOD_CHANNEL_FREE, this->sound, true, &soundChannel); //This is the Method to getvolume float SoundEmitter::GetVolume() { float currentVolume = 0.0f; float* volumePoint = ¤tVolume; soundChannel->getVolume(volumePoint); return currentVolume; } //this is the method to set volumes void SoundEmitter::SetVolume(float volume) { soundChannel->setVolume(volume); } [/code:1k0uwmoj] I am so clueless whats wrong with this block of code. Anybody can help me out? [/code] FMOD 4 caudex asked 8 years ago You must login to post comments Answers (3) Filter Sort by: Most Votes Newest FirstOldest FirstRandomRecently Active Post Answer Keyword Match all Match any Show accepted answers only 0 0 Check the FMOD_RESULT from your calls to getVolume() and setVolume(), you may be able to find out from that. Dogbert answered 8 years ago You must login to post comments 0 0 Like dogbert said, you should be checking the FMOD_RESULT returned by get/setvolume calls. Other things: result = tempSystem->playSound(FMOD_CHANNEL_FREE, this->sound,[b:1vec0tzp] true[/b:1vec0tzp], &soundChannel); I hope you're aware that the sound is paused. This line is redundant: float* volumePoint = ¤tVolume; This following would be sufficient: soundChannel->getVolume(¤tVolume); Guest answered 8 years ago You must login to post comments 0 0 Ahhhh there is a FMOD Error. got the error "An invalid object handle was used."…. Haha i figured it out, I called SetVolume() before i called this function: result = tempSystem->playSound(FMOD_CHANNEL_FREE, this->sound, true, &soundChannel); Thanks for the help…. totally forgot aobut FMOD Errors….. caudex answered 8 years ago You must login to post comments Showing 3 results Your Answer Please login first to submit. Categories FMOD 3 (4252) FMOD 4 (5120) FMOD 5 (213) FMOD Designer (1728) FMOD Studio (756) UE4 (215) Unity (337) TagsAndroid × 74FAQ × 62iOS &
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up FMOD channel setVolume doesn't work up vote 2 down vote favorite 1 I use this: err = channel->setVolume(someVolumeBetween0and1); Even if err is FMOD_OK, the volume doesn't change. Am http://www.fmod.org/questions/question/forum-28322/ I doing something wrong? Is there any way to change the volume for a sound(channel)? Is there other range for volume instead of [0, 1]? Thanks! EDIT: I use setVolume just after this: err = soundSystem->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); audio fmod share|improve this question asked Aug 25 '11 at 7:24 Felics 7,315873144 I think you need to post a little more code, set volume is quite basic. Have you tried modifying the playsound example with http://stackoverflow.com/questions/7186523/fmod-channel-setvolume-doesnt-work setVolume calls? Hows does that differ from your code? –Mathew Block Aug 29 '11 at 2:45 add a comment| 5 Answers 5 active oldest votes up vote 5 down vote accepted I found something about volume in the FMOD manual: "When a sound is played, it will use the sound's default frequency, volume, pan, levels and priority... To change channel attributes before the sound is audible, start the channel paused by setting the paused flag to true, and calling the relevant channel based functions. Following that, unpause the channel with Channel::setPaused." So, right code should like this: err = soundSystem->playSound(FMOD_CHANNEL_FREE, sound, true, &channel); err = channel->setVolume(someVolumeBetween0and1); err = channle->setPaused(false); share|improve this answer edited Dec 12 '12 at 11:07 Konrad Viltersten 1 answered Dec 12 '12 at 10:46 yuzebin 9613 add a comment| up vote 2 down vote change the order of setVolume and playSound, it works in my project share|improve this answer answered Mar 21 '12 at 12:53 Chelsea Wang 1691114 add a comment| up vote 1 down vote I'm not 100% sure, but the sound may need to be stopped/paused before setting the volume to unlock it and resume playing the sound after the volume has been set. Other things to check could be that the sound is being played on the correct channel (or that you are setting the volume on the correct channel). Is the
the FMOD API directory to the system path e.g."C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api". Create a new Environment Variable called FMOD_SDK, set it's value to also be the FMOD API directory e.g. http://glasnost.itcarlow.ie/~powerk/FMOD/Installing%20FMOD.html "C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api" Configuring a project to use FMOD http://us.battle.net/forums/en/wow/topic/2030063130 Create a new project. In Project Properties (see screen-shot below) select "all configurations" select "VC++ Directories" add "$(FMOD_SDK)\inc" to the list of include directories add "$(FMOD_SDK)\lib" to the list of library directories setting FMOD directories Running FMOD Add the following lines to any source files which will use FMOD Initialization. The simplest way to initialize fmod error fmod is to simply call System::init. Thats it. FMOD will set up the soundcard and other factors using default parameters. Let's have a look at an example of initializing FMOD Ex. Here we have the most basic setup of the FMOD engine. It will use 100 virtual voices. Loading a Sound A sound in FMOD corresponds to a audio file loaded in to memory or an audio stream. A fmod error in sound object contains the data for a piece of audio. Generally each sound file is loaded once (there in only a single instance of each piece of audio). Loading a sound does not cause it to play, but we need to load it before we can play it. Bear in mind that loading a compressed mp3 file into a sound object will cause the file to be decompressed and take up a large amount of memory. For large files it is better to use streams. Playing a Sound Sounds are played on channels. A channel is an instance of the playing sound. e.g. in a racing car game there may be one engine sound (sound file), but the sound will be played on many channels depending on the number of cars in the game.Each channel will have it's own volume and can be stop/started independantly. When dealing with 3D audio, each cannel will have its own position, velocity etc. In order to hear a sound we need to create a channel to play the sound on; You do not need to store the channel handle if you do not want to. That parameter can be 0 or NULL. This is useful if you
Report COMMUNITY General Discussion Oceanic General Discussion Guild Recruitment Oceanic Guild Recruitment Story Forum World’s End Tavern: Role-play and Fan Fiction LEGION TESTING 7.1 PTR Bug Report 7.1 PTR Discussion GAMEPLAY AND GUIDES New Player Help and Guides Returning Player Help and Discussion Quests Professions Pet Battles Dungeons, Raids and Scenarios Transmogrification Achievements UI and Macro PVP Arenas Battlegrounds CLASSES Death Knight Demon Hunter Druid Hunter Mage Monk Paladin Priest Rogue Shaman Warlock Warrior GAMING, HARDWARE, AND ENTERTAINMENT Games, Gaming and Hardware Movies, TV and Entertainment WEBSITE AND MOBILE FEEDBACK Website Bug Report Mobile Bug Report REALMS Aerie Peak Aman'Thul Area 52 Arthas Baelgun Barthilas Blackrock Bleeding Hollow Burning Legion Cenarius Dalaran Darkspear Earthen Ring Emerald Dream Frostmourne Garona Garrosh Hyjal Illidan Kel'Thuzad Kil'jaeden Korgath Lightbringer Mal'Ganis Moon Guard Proudmoore Ravenholdt Sargeras Saurfang Shattered Hand Stormrage Stormreaver Thrall Tichondrius Turalyon Wyrmrest Accord Zul'jin Aegwynn, Bonechewer, Daggerspine, Gurubashi, and Hakkar Agamaggan, Archimonde, Jaedenar, and The Underbog Aggramar and Fizzcrank Akama, Dragonmaw, and Mug'thol Alleria and Khadgar Alexstrasza and Terokkar Altar of Storms, Anetheron, Magtheridon, and Ysondre Alterac Mountains, Balnazzar, Gorgonnash, The Forgotten Coast, and Warsong Andorhal, Scilla, Ursin, and Zuluhed Antonidas and Uldum Anub’arak, Chromaggus, Crushridge, Garithos, Nathrezim, and Smolderthorn Anvilmar and Undermine Arathor and Drenden Argent Dawn and The Scryers Arygos and Llane Auchindoun, Cho'gall, and Laughing Skull Azgalor, Azshara, Destromath, and Thunderlord Azjol-Nerub and Khaz Modan Azuremyst and Staghelm Baelgun and Doomhammer Black Dragonflight, Gul'dan, and Skullcrusher Blackhand and Galakrond Blackwater Raiders and Shadow Council Blackwing Lair, Dethecus, Detheroc, Haomarush, Lethon, and Shadowmoon Bladefist and Kul Tiras Blade's Edge and Thunderhorn Blood Furnace, Mannoroth, and Nazjatar Bloodhoof and Duskwood Bloodscalp, Boulderfist, Dunemaul, Maiev, and Stonemaul Borean Tundra and Shadowsong Bronzebeard and Shandris Burning Blade, Lightning's Blade, and Onyxia Caelestrasz and Nagrand Cairne and Perenolde Cenarion Circle and Sisters of Elune Coilfang, Dark Iron, Dalvengyr, and Demon Soul Dawnbri