0 Favourites

Difficulty making a Music Player

This forum is currently in read-only mode.
  • 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 .

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

    Thanks in advance for your help!

    -Uzalu

  • 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:

    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.
  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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 )

    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.

  • 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

  • Here's three different ways of doing it:

    <img src="http://img41.imageshack.us/img41/4854/15449449.png">

    <img src="http://img8.imageshack.us/img8/6515/84213026.png">

    <img src="http://img252.imageshack.us/img252/4372/98556401.png">

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)