Ir para conteúdo
Fórum Script Brasil
  • 0

VB6 FMOD crash FSOUND_STREAM


LordLuc

Pergunta

o VB6 da crash após eu executar o sub abaixo 509 vezes, ou seja, na 510° vez ele da crash e não avisa nada apenas fica escrito enviar /não enviar relatorios...

Public Sub Play_Sound(ByVal sound As String)

Dim i As Long

Dim result As FMOD_ERRORS

If Not bInit_Sound Then Exit Sub

' exit out early if we have the system turned off

If Options.sound = 0 Then Exit Sub

' does it exist?

If Not FileExist(App.path & SOUND_PATH & sound) Then Exit Sub

' find the extension

Select Case Right$(sound, 4)

Case ".mid", ".s3m", ".mod"

' open the stream

SoundHandle = FSOUND_Stream_Open(App.path & SOUND_PATH & sound, FSOUND_LOOP_OFF, 0, 0)

' play it

For i = 1 To 31

If FSOUND_IsPlaying(i) = 0 Then

FSOUND_Stream_Play i, SoundHandle

FSOUND_SetVolume SoundHandle, 150

SoundCount = SoundCount + 1

Exit For

End If

Next i

Case ".wav", ".mp3", ".ogg", ".wma"

' open the stream

SoundHandle = FSOUND_Stream_Open(App.path & SOUND_PATH & sound, FSOUND_LOOP_OFF, 0, 0)

' play it

For i = 1 To 31

If FSOUND_IsPlaying(i) = 0 Then

FSOUND_Stream_Play i, SoundHandle

FSOUND_SetVolume SoundHandle, 150

SoundCount = SoundCount + 1

Exit For

End If

Next i

Case Else

Exit Sub

End Select

End Sub

DUVIDO super que alguém possa me ajudar...

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

Olá Lord, tudo bem?

Duvidou boubiou vei.. rsrs

Nunca usei o FSound_Stream, mas talvez, você esteja abrindo o arquivo, tocando e não esteja fechando o mesmo, e em um certo ponto, ele encontra um limite de alça aberta.

Para tocar sons eu uso a dll PlaySound, acho mais prático, não se preocupe com o volume, se o usuário quiser ouvir o som, ele aumenta na saída de som do pc.

Um abraço.

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...