Difficulty making a Music Player

For questions about using Classic.

Post » Thu Dec 16, 2010 6:04 pm

Hi construct community.

Probably a simple question, this one... i have been trying to make a music playing application in an attempt to make a more purpose-built version of my customized foobar. Thus far, i have done nothing because i can't get XAudio2 to play music files.

I want to give the option to select a folder to load music from (maybe even several folders), but because i only seem to be allowed to use music in the AppPath, or add resources (~17.6GB of music?) i can't do this reasonably.

I would have thought it would be simple enough to just type the path of a directory to load all the music from (maybe with sub-directory support built in?) and play any of those songs from a list once loaded, but as it is, i can't even get it to play a song with that song's path name. This is typical microsoft, there always has to be a complicated way of doing something otherwise simple :roll: .

sorry if this has been said already, i have searched.

Thanks in advance for your help!
-Uzalu
B
3
G
2
Posts: 14
Reputation: 728

Post » Thu Dec 16, 2010 6:54 pm

It might just be an issue of a missing backslash when typing the path.

Say you type the directory path as "C:\mypath".
Then you try to play a file: [code:oq8iyssp]path & "music1.mp3"[/code:oq8iyssp]
The result will be a wrong path "C:\mypathmusic1.mp3" so no sound will play.
Just be sure to include a trailing backslash to the path and it should work.
B
79
S
24
G
52
Posts: 4,723
Reputation: 39,709

Post » Fri Dec 17, 2010 5:18 pm

I use the following path to play sounds-

On button press(example)

> XAudio2 Autoplay file > AppPath & "sounds\song1.ogg"

The 'song1.ogg' file is located in 'sounds' folder.

Hope it helps.
B
19
S
6
G
7
Posts: 1,203
Reputation: 7,294

Post » Sat Dec 18, 2010 9:16 pm

Thanks for the suggestions guys, R0J0hound, i don't quite understand what you mean... perhaps just type what a working event would look like? (when you enter the path and file name, what is it exactly i am missing?). I think you might be saying i need another backslash at the end of the entire string, but i don't think even windows would be anal enough to require that. (but i might be suprised :lol: )

Again, thank you both for the help, i can't try anything out for a little while now because i just reinstalled windows... so, construct is high on the list of things to reinstall.
B
3
G
2
Posts: 14
Reputation: 728

Post » Sat Dec 18, 2010 10:23 pm

Still not working, i have tried all the variations i can think of, in both play music and autoplay file. I just need a typed, or .cap example... that would be much appreciated :D
B
3
G
2
Posts: 14
Reputation: 728

Post » Sat Dec 18, 2010 10:53 pm

Here's three different ways of doing it:




B
4
S
1
G
3
Posts: 10
Reputation: 1,159


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests