Android Question Soundpool Clips Playback

Discussion in 'Android Questions' started by RichardN, May 7, 2015.

  1. RichardN

    RichardN Active Member Licensed User

    I have an app that should play a certain 'jingle' when required by program activity. I realise the Audio Lib Soundpool object has limitations but I have a 10 second 'jingle' (~300kb) that completely refuses to play more than the first ~6 seconds before cutting out.

    I have tried .mp3 / .wav / .ogg files all of various bitrates. I thought maybe it was a memory issue so tried 'Large Heap' in the manifest but all with no success. Strangely it always cuts at precisely the same point irrespective of soundfile type, size or bit-rate. I am using the following code:

    Sub Process_Globals
    Dim Sp As SoundPool
    End Sub

    Sub Globals
    Dim Jingle As Int
    End Sub

    Sub Activity_Create(FirstTime As Boolean)

    If FirstTime Then
            Jingle = Sp.Load(
    End If

    End Sub

    Sub Activity_Resume
    End Sub

    Any ideas ???
    Last edited: May 7, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is not related to the available memory. SoundPool can only be used for short audio playbacks. You should use MediaPlayer instead.