Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Failed to submit music source voice in main.agc

Author
Message
Hubert BAYRE
7
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 16th Dec 2017 21:00
Hello.
After playing some ogg files with PlayMusicOGG, my program exit with this red message (debug mode) :
"Failed to submit music source voice in main.agc at line ..."
Is it an error with an ogg file ?
Many thanks.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 16th Dec 2017 21:52 Edited at: 16th Dec 2017 21:52
How about letting us have a look at that line number reported in the error message?

If we can see that line of code, then we stand a better chance of knowing what's happening.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Hubert BAYRE
7
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 17th Dec 2017 17:35
the line number returned is never the same.
Hubert BAYRE
7
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 17th Dec 2017 18:21 Edited at: 17th Dec 2017 18:27
- Seems to be a issue with PlayMusicOgg, but i don't know exactly where is the problem. I've put some ogg files names into as array. Next i play them as a 'playlist'. Perhaps should i add a sleep delay before reload an track after an DeleteMusiccOgg ?
- When i test the 'loop' manually and press a key to go to the next track, i've not the error. A memory issue ?

pseudo code :

(into the main loop)

do ...

if GetMusicPlayingOGG(1) = FALSE
Play_next_track()
endif

sync()
until game_finished

Function Play_next_track()
if GetMusicExistsOgg (1) = TRUE
StopMusicOGG (1)
DeleteMusicOGG (1)
endif
LoadmusicOgg(1, another_FileName_from_array)
PlayMusicOgg(1)
EndFunction


extract from my program
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 17th Dec 2017 21:14 Edited at: 17th Dec 2017 21:32
Just curious, but why are you using TRUE and FALSE in conditions instead if 1 and 0 ???

if GetMusicExistsOgg (1) = TRUE

if GetMusicExistsOgg (1) = 1

if GetMusicExistsOgg (1)

Some people use the latter but I like to use the 1 because of the information in the help manual.

Quote: "GetMusicExistsOGG
Description

Returns 1 if a music file exists at the specified ID, 0 otherwise. "


I get errors just trying to compile that single condition when using TRUE instead of 1

Quote: "Musique_bJoue = TRUE"

That is not going to work either.

Musique_bJoue is an integer type, so it can only contain integer values like 1 or 0

True is a word, which is a string, and would require a string variable to hold that value, and they are identified with a $ as in Musique_bJoue$

Even then, the value for the string would have to be in quotes if plain text such as Musique_bJoue$ = "TRUE"

If you wanted a string to be assigned the value of another string then it would be like Musique_bJoue$ = Conjured$

A combinations of strings or values converted to strings would be like so... Musique_bJoue$= Conjured$ + " is right if TRUE equals " + str(1)

All you need for flags though are integers with 1 and 0 values for true or false.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Hubert BAYRE
7
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 17th Dec 2017 22:37
In fact i use

#constant TRUE 1
#constant FALSE 0
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 18th Dec 2017 00:40 Edited at: 18th Dec 2017 00:42
Quote: "In fact i use

#constant TRUE 1
#constant FALSE 0"


Oh okay, I couldn't see that from your snippet.

"Beware that using constant names that match reserved words like print will cause your program to change radically and should be avoided. "

I never use them like that, because for me it is easier to type 1 than TRUE. (guess I'm lazy)

Sorry I couldn't help.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Hubert BAYRE
7
Years of Service
User Offline
Joined: 21st Oct 2017
Location: France
Posted: 18th Dec 2017 05:45
i prefer use TRUE or FALSE for reading purpose. I inspect my code to find perhaps another cumulative error. I don't know if agk use an external sound program to update ? Many thanks for your help Conjured.

Login to post a reply

Server time is: 2024-11-24 04:25:41
Your offset time is: 2024-11-24 04:25:41