2011-07-31 11 views
1

私はAudacityを使用して多数のサウンドクリップを作成し、サウンドプールに.OGGファイルとしてエクスポートしました。長いクリップの中には早く止まるものもあります。サウンドプールの各クリップの長さは設定されていますか?それは私が広げることができるものですか?ここでAndroidのサウンドクリップが長くなります

は私SoundManagerです:

package com.androidbook.ufgsoundboard; 

import java.util.HashMap; 

import android.content.Context; 
import android.media.AudioManager; 
import android.media.SoundPool; 



public class SoundManager { 

    private SoundPool mSoundPool; 
    private HashMap<Integer, Integer> mSoundPoolMap; 
    private AudioManager mAudioManager; 
    private Context mContext; 
    public static final int maxSounds = 1; 

    public SoundManager() 
    { 

    } 

    public void initSounds(Context theContext) { 
     mContext = theContext; 
     mSoundPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0); 
     mSoundPoolMap = new HashMap<Integer, Integer>(); 
     mAudioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);   
    } 

    public void addSound(int Index,int SoundID) 
    { 
     mSoundPoolMap.put(Index, mSoundPool.load(mContext, SoundID, 1)); 

    } 

    public void playSound(int index) { 

     int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); 
     mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, 0, 1f); 
    } 


} 

答えて

0

私は11025 HZ 16ビットのOGGファイルとしてのAudacityに私のオリジナルサウンドクリップを保存する必要がありました。これにより、クリップの長さを私が望む限り長くすることができます。

関連する問題