fbsound 1.1 crash

Linux specific questions.
Post Reply
Mysoft
Posts: 815
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

fbsound 1.1 crash

Post by Mysoft »

so tried this minimal sample of fbsound 1.1 (dynamic) on ubuntu 20.04 with 64bit version of fbsound...

Code: Select all

#include "fbsound_dynamic.bi"

dim shared as integer IsPlaying

sub playmp3(f as STRING)	 
	if IsPlaying then FBS_End_MP3Stream()	
	FBS_Create_MP3Stream(f)
	FBS_Play_MP3Stream()
  IsPlaying=true
	sleep	
End Sub

if FBS_Init()=false then
  print "Failed to init fbsound"
else
  playmp3("test.mp3")
  playmp3("test2.mp3")
end if
sleep
but it crashes right away without playing anything...
Aborting due to runtime error 12 ("segmentation violation" signal) in ~/fbsound_test.bas::PLAYMP3()

same thing works on windows 7 32bit... i assume its a bug on fbsound itself
D.J.Peters
Posts: 8440
Joined: May 28, 2005 3:28
Contact:

Re: fbsound 1.1 crash

Post by D.J.Peters »

if you need more than one MP3 file use FBS_Load_MP3File !

Code: Select all

#include "../inc/fbsound_dynamic.bi"

if FBS_Init()=false then
  print "Failed to init fbsound"
  beep:sleep:end 1
end if

dim as integer hWave1
if FBS_Load_MP3File("test.mp3",@hWave1)=false then
  print "Failed to load 'test.mp3' !"
  beep:sleep:end 1 
end if  
print "test.mp3 loaded" 

dim as integer hWave2
if FBS_Load_MP3File("test2.mp3",@hWave2)=false then
  print "Failed to load 'test2.mp3' !"
  beep:sleep:end 1 
end if  
print "test2.mp3 loaded"  

print "press [1] or [2] or [ESC]" 
var key = inkey()
while key<>chr(27)
  if key="1" then ? "1" : FBS_Play_Wave(hWave1)
  if key="2" then ? "2" : FBS_Play_Wave(hWave2)
  sleep 100 
  key = inkey()
wend
if you need two playing MP3 streams one after the other use this:

Joshy

Code: Select all

#include "../inc/fbsound_dynamic.bi"

sub playmp3(f as STRING)   
  while FBS_Get_PlayingStreams()>0
    print ".";
    FBS_End_MP3Stream()   
    sleep 100
  wend  
  if FBS_Create_MP3Stream(f)=false then
    print "error: can't ceate mp3 stream " & f & " !"
  else
    FBS_Play_MP3Stream()    
    while FBS_Get_PlayingStreams()=0
      sleep 100
    wend  
  end if
End Sub

if FBS_Init()=false then
  print "Failed to init fbsound"
else
  ' play stream test.mp3 for one second !
  playmp3("test.mp3")
  sleep 1000
  ' play stream test2.mp3
  playmp3("test2.mp3")
end if
sleep
Mysoft
Posts: 815
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: fbsound 1.1 crash

Post by Mysoft »

ok, so i have to be persistant on the state for it to work i see, on windows that was not required but good to know

yeah loading is not an option because it wastes ram like crazy and takes a bunch to load a whole mp3, but thats what the code had at first

i will try the updated code... btw theres any function information/manual that talks about those being required?
Mysoft
Posts: 815
Joined: Jul 28, 2005 13:56
Location: Brazil, Santa Catarina, Indaial (ouch!)
Contact:

Re: fbsound 1.1 crash

Post by Mysoft »

D.J.Peters wrote:if you need two playing MP3 streams one after the other use this:
that didnt solved it on linux.... still crashes misteriously
(i even added extra checks to make sure it does not try to do something when creating the stream/play fails)
but no dice...
D.J.Peters
Posts: 8440
Joined: May 28, 2005 3:28
Contact:

Re: fbsound 1.1 crash

Post by D.J.Peters »

First does all tests in test folder works so far on your Linux box ?
Do you tryed fbound 1.2 (the latest version) also ?

Joshy
Post Reply