Page 1 sur 2

bug avec le OggVorbis ! [ RESOLU]

Publié : jeu. 23/juin/2005 23:46
par Backup
il m'a ete impossible d'utiliser le format ogg
en utilisant les includebinary et catchsound !!!

le ogg marche si on le charge avec loadsound mais pas en include !!
le purebasic dit que le fichier n'est pas initialisé !

(bien sur j'avais usé du plugin offert par le pure !

a voir ! :? :?

Publié : dim. 26/juin/2005 13:39
par Marcus
Voici commen j'inclus un ogg

Code : Tout sélectionner

InitSprite() : InitKeyboard() : InitSound() : UseOGGSoundDecoder()

OpenScreen(1024,768,32,"")

CatchSound(0, ?zik,?zikend-?zik)
PlaySound(0,1)

Repeat
  
  FlipBuffers()
  ClearScreen(0,0,0)
  ExamineKeyboard()
  
Until KeyboardPushed(#PB_Key_Escape)
StopSound(0)
End

zik:
IncludeBinary"zik.ogg"
zikend:
Ou en recreant le fichier au lieu d'utiliser CatchSound()

Code : Tout sélectionner

InitSprite() : InitKeyboard() : InitSound() : UseOGGSoundDecoder() 


OpenScreen(1024,768,32,"") 

If CreateFile(1,"zik.ogg")     
  UseFile(1)     
  L1= ?zikend-?zik      
  WriteData(?zik,L1)     
  CloseFile(1)
  LoadSound(0,"zik.ogg")
  DeleteFile("zik.ogg")
Else :End 
EndIf 

PlaySound(0,1)

Repeat 
  
  FlipBuffers()
  ClearScreen(0,0,0)
  ExamineKeyboard() 
  
Until KeyboardPushed(#PB_Key_Escape)
StopSound(0)
End

zik:
IncludeBinary"zik.ogg"
zikend:

Publié : dim. 26/juin/2005 16:44
par Backup
Merci ..

mais c'est quand meme curieux que ça , ça ne fonctionne pas !

(a tester avec debug en mode step)

Code : Tout sélectionner

UseOGGSoundDecoder()
InitSound() 
CatchSound( 1, ?sonphosphene)



DataSection 
sonphosphene:
IncludeBinary "purenoide.ogg"  
EndDataSection   

PlaySound(1,1)


je vais essayer en mettant une taille comme tu l'a fait ! :)

Publié : dim. 26/juin/2005 17:00
par Backup
non ! ça marche pas !!



bah ça !!!


pourquoi mon exemple ne fonctionne pas en mode debug
et que le tien marche !! ?????


purenoide.ini est en fait un ogg dont j'ai changé l'extension !
mais meme avec la bonne extention ça marche pas pour moi !! ???

a executer en mode debug !



le tiens

Code : Tout sélectionner

 InitSprite() : InitKeyboard() : InitSound() : UseOGGSoundDecoder()

OpenScreen(1024,768,32,"")

CatchSound(0, ?zik,?zikend-?zik)
PlaySound(0,1)

Repeat
        
        FlipBuffers()
        ClearScreen(0,0,0)
        ExamineKeyboard()
        
Until KeyboardPushed(#PB_Key_Escape)
StopSound(0)
End

zik:
IncludeBinary"purenoide.ini"
zikend:

le mien :

Code : Tout sélectionner


UseOGGSoundDecoder()
InitSound() 
CatchSound(0, ?sonphosphene,fin-sonphosphene)

PlaySound(0,1)



DataSection 
sonphosphene:
IncludeBinary "purenoide.ini"  
fin:
EndDataSection   


aurai je oublié quelques choses ??

on est obliger d'ouvrir un ecran ?
8O 8O

en plus tu n'emploie mem pas "UseOGGSoundDecoder()" ???

Publié : dim. 26/juin/2005 20:17
par Marcus
t'oublies les ?

tu ecris :

Code : Tout sélectionner

CatchSound(0, ?sonphosphene,fin-sonphosphene)
au lieu de :

Code : Tout sélectionner

CatchSound(0, ?sonphosphene,  ?fin-  ?sonphosphene)
en plus tu n'emploie mem pas "UseOGGSoundDecoder()" ???
Mais si en 1er ligne du code .

Code : Tout sélectionner

IncludeBinary "purenoide.ini" 
pourquoi un fichier .ini !??? au lieu d'un .ogg !

Publié : dim. 26/juin/2005 21:11
par Backup
CatchSound(0, ?sonphosphene,fin-sonphosphene)
:oops: :oops: je suis fatigué moi !!
mais bon ça marche pas plus !! il me dit que le l'objet son est pas initialisé !

a tu essayer mon listing avec un de tes sons ogg ?
chez moi mon listing plante , et franchement je vois pas pourquoi !!

si !! ya bien un bug !!!!

le fait d'enfermer

Code : Tout sélectionner

sonphosphene:
IncludeBinary "purenoide.ogg"  
fin:
dans DataSection ------- EndDataSection
fait que ça plante !!!

si ont ne met pas DataSection ------- EndDataSection
ça marche !!!


Merci quand Meme Marcus tu m'a bien aidé !!

mais ya bien un bug du purebasic !! :D


ce code plante

Code : Tout sélectionner

CallDebugger
UseOGGSoundDecoder()
InitSound() 
CatchSound(0, ?sonphosphene,?fin-?sonphosphene)

PlaySound(0,1)

 DataSection 
sonphosphene:
IncludeBinary "purenoide.ogg"  
fin:
EndDataSection   

celui-ci fonctionne

Code : Tout sélectionner

CallDebugger
UseOGGSoundDecoder()
InitSound() 
CatchSound(0, ?sonphosphene,?fin-?sonphosphene)

PlaySound(0,1)

;DataSection 
sonphosphene:
IncludeBinary "purenoide.ogg"  
fin:
;EndDataSection   

Publié : dim. 26/juin/2005 21:19
par Backup
en fait la doc du pure nous induit en erreur
voici ce qu'elle dit
Exemple:
CatchSound(0, ?Music)
End

DataSection <-------------------------------- pourquoi ça ????? :evil:
Music: IncludeBinary "Sound.wav"

Publié : dim. 26/juin/2005 21:20
par Marcus
j'avais pas remarqué tes DataSection !

pourquoi utilise tu cela avec des includes ? c'est plutot reservé au données DATAS

c'est pas un bug ca !

Publié : dim. 26/juin/2005 21:21
par Backup
regarde le message juste au dessus :D

Publié : dim. 26/juin/2005 21:36
par Marcus
Effectivement la doc induit en erreur faut lire ici dans "DataSection" ...ALLO Fred !

(partie du code consacré au donnée) plutot que le mot clé "DataSection"


la doc sur "IncludeBinary" n'en parle pas :
Syntax
IncludeBinary "NomFichier"

Description

IncludeBinary inclut le fichier nommé à l'endroit où la commande est placée.
Exemple:

IncludeBinary "Data\map.data"

Publié : dim. 26/juin/2005 22:32
par Droopy
Merci pour l'astuce :D

Publié : lun. 27/juin/2005 19:43
par Backup
j'ai trouvé !!!

en fait il n'y a pas de bug !!

pour le oggvorbis il faut 1er bien indique le debut et la LONGUEUR

et deuxiement si l'on utilise plusieur son a integrer il FAUT mettre

DataSection et endDataSection c'est OBLIGATOIRE sinon ça marche pas

voici l'extrait de mon programme "Purenoide !"
voici comment il faut integrer du OggVorbis !!

la seule diference avec le wav
c'est la specification de la longueur de l'échantillon , qui dans le cas du Wav n'est pas obligatoire !!

par contre la doc n'indique pas le " EndDataSection " !!!!!!!!

et effectivement l'utilisation des includes devrai etre indiqué dans la partie
relatif a DataSection---------EndDataSection :D

voici comment ça marche chez moi !!
si l'on retire les DataSection---------EndDataSection
cela ne marche plus !!!!

j'en deduit que pour plusieur son a integrer il faut utiliser les
DataSection---------EndDataSection :D

Code : Tout sélectionner

 CatchSound(#son_lasergun, ?sonlaser,?fin_sonlaser-?sonlaser)
        CatchSound(#son_LONG, ?sonlong,?fin_sonlong-?sonlong)
        CatchSound(#son_PING, ?sonping,?fin_sonping-?sonping)
        CatchSound( #son_alien_meurt, ?son_alien_meurt,?fin_son_alien_meurt-?son_alien_meurt)
        CatchSound( #son_COURT, ?soncourt,?fin_soncourt-?soncourt)
        CatchSound( #son_engine, ?sonengine,?fin_sonengine-?sonengine)
        CatchSound( #son_EXPLODE1, ?sonexplode1,?fin_sonexplode1-?sonexplode1)
        CatchSound( #son_HITBALL, ?sonhitball,?fin_sonhitball-?sonhitball)
        CatchSound( #son_WHIP, ?sonwhip,?fin_sonwhip-?sonwhip)
        CatchSound( #son_THUMP, ?sonthump,?fin_sonthump-?sonthump)
        CatchSound( #son_Select, ?sonselect,?fin_sonselect-?sonselect)
        CatchSound( #son_Sable, ?sonsable,?fin_sonsable-?sonsable)
        CatchSound( #Son_phosphene, ?sonphosphene,?fin_sonphosphene-?sonphosphene)

;{ include binary
        DataSection 

  ;{ include SONS
        sonlaser:
        IncludeBinary "lasergun.ogg"
        fin_sonlaser:
        
        sonlong:
        IncludeBinary  "long.ogg"
        fin_sonlong:
        
        sonping:
        IncludeBinary "ping.ogg"
        fin_sonping:
        
        son_alien_meurt:
        IncludeBinary "alien_meurt.ogg"
        fin_son_alien_meurt:
        
        soncourt:
        IncludeBinary "court.ogg"
        fin_soncourt:
        
        sonengine:
        IncludeBinary  "engine.ogg"
        fin_sonengine:
        
        sonexplode1:
        IncludeBinary "explode1.ogg"
        fin_sonexplode1:
        
        sonhitball:
        IncludeBinary "hitball.ogg"
        fin_sonhitball:
        
        sonwhip:
        IncludeBinary  "whip.ogg"
        fin_sonwhip:
        
        sonthump:
        IncludeBinary "thump.ogg"
        fin_sonthump:
        
        sonselect:
        IncludeBinary "select.ogg"
        fin_sonselect:
        
        sonsable:
        IncludeBinary "sable.ogg" 
        fin_sonsable:
        
        sonphosphene:
        IncludeBinary "phosphene.ogg"  
        fin_sonphosphene:
        
        EndDataSection 





Publié : lun. 27/juin/2005 20:57
par Marcus
pour le oggvorbis il faut 1er bien indique le debut et la LONGUEUR


bé c'est bien ce que j'ai dis :

Code : Tout sélectionner

CatchSound(0, ?zik,?zikend-?zik)
et deuxiement si l'on utilise plusieur son a integrer il FAUT mettre

DataSection et endDataSection c'est OBLIGATOIRE sinon ça marche pas
Obligatoire !...A bon ? chez moi ca marche avec plusieurs ogg inclus m^m sans Datasection ... EndDataSection !

Publié : lun. 27/juin/2005 22:21
par Backup
Citation:
pour le oggvorbis il faut 1er bien indique le debut et la LONGUEUR


bé c'est bien ce que j'ai dis :
j'ai pas dit que tu l'avais pas dit !!, je confirme en ecrivant

" il faut bien indiquer " sous entendant (comme Marcus l'a dit !! ) :D
et comme indiqué dans la doc !


par contre tu integre combien de ogg vorbiss sans le
DataSection---------EndDataSection ???

ou peut etre que justement le DataSection---------EndDataSection
est obligatoire lorsque l'on integre plusieur ogg et plusieurs images
comme pour mon jeux !! 8O

bref y a bien un probleme quelque part !!
car je t'affirme que si je retire le DataSection---------EndDataSection
concernant les include de mon listing , le programme plante !!
avec la v 3.93 ! :?

d'ailleurs la doc indique en exemple qu''il faut utiliser " DataSection"
il y a juste un oubli dans la doc de " EndDataSection"
ce qui indique que d'une certaine maniere la doc me donne raison
le DataSection---------EndDataSection est obligatoire

et le fonctionnement sans plantage d'un include depourvu de DataSection---------EndDataSection devrai etre consideré comme un bug !!

seul Fred pourai nous repondre ! ....

Publié : lun. 27/juin/2005 23:04
par Droopy
Dobro : Essaye de mettre un End juste avant ton includeBinary