Code example for AssetManager

Methods: openFd

0
	@Override 
	public Sound newSound(String filename)
	{ 
		try 
		{ 
			AssetFileDescriptor assetDescriptor = assets.openFd(filename);
			int soundId = soundPool.load(assetDescriptor, 0);
			return new AndroidSound(soundPool, soundId);
		} 
		catch (IOException ex)
		{ 
			throw new RuntimeException("Couldn't load sound \"" +
					filename + "\"");
		} 
	} 
}