0
0

Hi,

Does the Subsounds now support samples, or just streams ?

And will it support samples ?

David

  • You must to post comments
0
0

I edited the vb realtimestiching example:

[code:3rryhif0]Private Sub Form_Load()
Dim result As FMOD_RESULT
Dim version As Long
Dim exinfo As FMOD_CREATESOUNDEXINFO
Dim soundlist(0 To 1) As Long

exinfo.cbsize = 72      ' sizeof(FMOD_CREATESOUNDEXINFO)

soundname = Array( _
        "../../examples/media/e.ogg", "../../examples/media/d.ogg", _
        "../../examples/media/c.ogg", "../../examples/media/d.ogg", _
        "../../examples/media/e.ogg", "../../examples/media/e.ogg", _
        "../../examples/media/e.ogg", "../../examples/media/e.ogg", _
        "../../examples/media/d.ogg", "../../examples/media/d.ogg", _
        "../../examples/media/d.ogg", "../../examples/media/d.ogg", _
        "../../examples/media/e.ogg", "../../examples/media/e.ogg", _
        "../../examples/media/e.ogg", "../../examples/media/e.ogg", _
        "../../examples/media/e.ogg", "../../examples/media/d.ogg", _
        "../../examples/media/c.ogg", "../../examples/media/d.ogg", _
        "../../examples/media/e.ogg", "../../examples/media/e.ogg", _
        "../../examples/media/e.ogg", "../../examples/media/e.ogg", _
        "../../examples/media/d.ogg", "../../examples/media/d.ogg", _
        "../../examples/media/e.ogg", "../../examples/media/d.ogg", _
        "../../examples/media/c.ogg", "../../examples/media/c.ogg", _
        "../../examples/media/c.ogg", "../../examples/media/c.ogg")

' Create a System object and initialize.
result = FMOD_System_Create(system)
ERRCHECK (result)

result = FMOD_System_GetVersion(system, version)
ERRCHECK (result)

If version <> FMOD_VERSION Then
    MsgBox "Error!  You are using an old version of FMOD " & Hex$(version) & ". " & _
           "This program requires " & Hex$(FMOD_VERSION)
End If

result = FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, 0)
ERRCHECK (result)


' Set up the FMOD_CREATESOUNDEXINFO structure for the user stream with room for 2 subsounds. (our subsound double buffer)
exinfo.cbsize = FMOD_CREATESOUNDEXINFO_SIZE
exinfo.defaultfrequency = 44100
exinfo.numsubsounds = 2
exinfo.numchannels = 1
exinfo.format = FMOD_SOUND_FORMAT_PCM16

' create the 'parent' stream that contains the substreams.  Set it to loop so that it loops between subsound 0 and 1.
result = FMOD_System_CreateSoundEx(system, 0, FMOD_DEFAULT + FMOD_OPENUSER, exinfo, sound)
ERRCHECK (result)


' Add 2 of our streams as children of the parent.  They should be the same format (ie mono/stereo and bitdepth) as the parent sound.
' When subsound 0 has finished and it is playing subsound 1, we will swap subsound 0 with a new sound, and the same for when subsound 1 has finished,
' causing a continual double buffered flip, which means continuous sound.
result = FMOD_System_CreateSound(system, soundname(0), FMOD_DEFAULT + FMOD_CREATESAMPLE, subsound(0))
ERRCHECK (result)

result = FMOD_System_CreateSound(system, soundname(1), FMOD_DEFAULT + FMOD_CREATESAMPLE, subsound(1))
ERRCHECK (result)

result = FMOD_Sound_SetSubSound(sound, 0, subsound(0))
ERRCHECK (result)

result = FMOD_Sound_SetSubSound(sound, 1, subsound(1))
ERRCHECK (result)


' Set up the gapless sentence to contain these first 2 streams.
soundlist(0) = 0
soundlist(1) = 1

result = FMOD_Sound_SetSubSoundSentence(sound, soundlist(0), 2)
ERRCHECK (result)

subsoundid = 0
sentenceid = 2     ' The next sound to be appeneded to the stream.

' Play the sound.
result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, channel)
ERRCHECK (result)

End Sub[/code:3rryhif0]

Changing the CreateStream to CreateSound, and get an error 23 in the SetSubSounSentence. By changing it back to Stream it works.

BTW: The are some minor bugs in the VB examples. For example FMOD_Normal instead of FSOUND_DEFAULT. And it crashes after an error since it does not close the FSOUND before end.

  • You must to post comments
0
0

How do i specify sentencing ?

And will sample stiching be supported ?

And what’s the difference between sentencing and stitching ?

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.