Hi everyone,
I’m trying to build a music player in Construct 2.
The idea is that the user can upload an external audio file using the FileChooser and then play it inside the app.
However, I have a problem:
When I try to use the Audio → Play action, Construct always forces me to choose an internal project sound (like “SOUND_SAMPLE”).
It does not allow me to use a URL or FileChooser.FileURLAt().
If I try to type the URL manually, the action turns red and becomes invalid.
Here is my event setup:
• Line 3: FileChooser → On changed → AJAX.Request(FileChooser.FileURLAt())
• Line 5: AJAX → On completed → Call "PlayExternal" (AJAX.LastData)
• Line 6: Function → On "PlayExternal" → (I want to play the external file here)
• Line 8: List → On double-clicked → Set playingSong to List.SelectedIndex
My question:
How can I correctly play an external audio file (a URL returned by FileChooser) in Construct 2?
Does Construct 2 officially support playing audio from a URL, or does it only support internal project sounds?
[Construct 2]
Thanks!