Results 1 to 4 of 4

Thread: How to unload specific sounds

  1. #1

    Default How to unload specific sounds

    Hello,

    Is this functionality missing from the SDK? I want to unload some sounds without killing everything. How can I do that?

    Thanks

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,340

    Default

    It's missing.

    There is a:

    Code:
    virtual void KillCachedSounds(bool bKillMusic, bool bKillLooping, int ignoreSoundsUsedInLastMS, int killSoundsLowerPriorityThanThis, bool bKillSoundsPlaying) {};
    But I believe the ignoreSoundsUsedInLastMS parm is being ignored on Android, and the standard iOS audio system (not the FMOD iOS version) seems to ignore it altogether and never unload sounds.

    Note: When sounds are played as "music" the last one is released automatically.
    Seth A. Robinson
    Robinson Technologies

  3. #3

    Default

    I'm currently using this DeleteSoundObjectByFileName, but it's only available on Fmod. Going to write one similar for iOS.

  4. #4

    Default

    Here's the iOS version.
    But! Because I'm still using your first SDK, and only copied the audio parts, you might find some weird things here. I'm not using the list and string classes, so modify this as needed.

    Code:
    bool AudioManagerOS::DeleteSoundObjectByFileName(const char *fName)
    {
    	for (int i=0; i < m_audioListSize; i++)
    	{
    		if (strcmp((m_audioList[i]->fName), fName) == 0)
    		{
    			AudioServicesDisposeSystemSoundID(m_audioList[i]->m_id);
    			SAFE_DELETE(m_audioList[i]);
    			for (int j = i ; j < m_audioListSize - 1 ; j++)
    				m_audioList[j] = m_audioList[j+1];
    			
    			m_audioListSize--;
    			return true;
    		}
    	}
    	
    	return false;
    }

Similar Threads

  1. Proper use of "unload level" ?
    By speeder in forum Novashell Game Creation System
    Replies: 6
    Last Post: 07-25-2010, 02:55 PM
  2. This sounds really dumb, but...
    By in forum Dink Smallwood HD
    Replies: 1
    Last Post: 11-08-2004, 07:12 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •