1. Play WAV file in Win10 with Eu 3

Going back to the old Euphoria 3, which I love, I need to play a WAV file. I'm using Windows10 64bit. But the playSound() routine does nothing. Even playSound("bell.wav") does nothing; every call just gives a ding. I have tried on two machines and various locations of wav files with no joy. And I can't find any basic program which can just play a wav and terminate.
Does anyone have any ideas? I have a simple voice recorder I have designed with GPS, and just want to play the verbal notes back from my Euphoric program as well as show the location on a map. The hard bit done, the easy bit stumps me!
Andy

new topic     » topic index » view message » categorize

2. Re: Play WAV file in Win10 with Eu 3

Eu 3? was that 16 bit?

Chris

new topic     » goto parent     » topic index » view message » categorize

3. Re: Play WAV file in Win10 with Eu 3

ChrisB said...

Eu 3? was that 16 bit?

Chris

Eu 3.1.1 I think is actually 32bit. I'm surprised you remember 16 bit systems. Eu3 was the last version produced by Rob Craig, who invented Euphoria. Or are you just pulling my leg??

new topic     » goto parent     » topic index » view message » categorize

4. Re: Play WAV file in Win10 with Eu 3

Any joy with http://phix.x10.mx/pmwiki/pmwiki.php?n=Main.RandomwavPlayer ?

new topic     » goto parent     » topic index » view message » categorize

5. Re: Play WAV file in Win10 with Eu 3

I tried that, it wouldn't run under Eu3 and though I have Eu4 installed I can't persuade it to play ball. The program uses playSound() still which, though I have used it in the past OK, no longer seems to function under Win10. I don't know why this should be but I do know Win10 has done some odd things to existing functionality. I might try running my playSound() test program on WinXP and see if it works there; it ought to since it used to work!
I need to find a machine with XP on it...

new topic     » goto parent     » topic index » view message » categorize

6. Re: Play WAV file in Win10 with Eu 3

I tried the demo playsounds.exw and it works on my Win10 x84 PC with EU 3.11.

Jean-Marc

new topic     » goto parent     » topic index » view message » categorize

7. Re: Play WAV file in Win10 with Eu 3

AndyDrummond said...
ChrisB said...

Eu 3? was that 16 bit?

Chris

Eu 3.1.1 I think is actually 32bit. I'm surprised you remember 16 bit systems. Eu3 was the last version produced by Rob Craig, who invented Euphoria. Or are you just pulling my leg??

Not at all! smile

Looks like it may be getting sorted, but I might have considered something a bit more 'modern', like one of the current DLLs floating about.

Cheers

Chris

new topic     » goto parent     » topic index » view message » categorize

8. Re: Play WAV file in Win10 with Eu 3

jmduro said...

I tried the demo playsounds.exw and it works on my Win10 x84 PC with EU 3.11.

Jean-Marc

Oh. Confusion then reigns. I will try again. Something odd going on, but I can't try it again today - pressure of work!
I agree playSound() really ought to work ...

Andy

new topic     » goto parent     » topic index » view message » categorize

9. Re: Play WAV file in Win10 with Eu 3

So, is it right then, that there is no embedded way of playing a sound in Eu 4.x, apart from loading a library to do it? No playsound() equivalent?

Chris

new topic     » goto parent     » topic index » view message » categorize

10. Re: Play WAV file in Win10 with Eu 3

AndyDrummond said...

Going back to the old Euphoria 3, which I love, I need to play a WAV file. I'm using Windows10 64bit. But the playSound() routine does nothing. Even playSound("bell.wav") does nothing; every call just gives a ding. I have tried on two machines and various locations of wav files with no joy. And I can't find any basic program which can just play a wav and terminate.
Does anyone have any ideas? I have a simple voice recorder I have designed with GPS, and just want to play the verbal notes back from my Euphoric program as well as show the location on a map. The hard bit done, the easy bit stumps me!

Just to be clear, we're talking about the Win32Lib playSound() routine, right? This isn't something built into Euphoria? There was only sound() for DOS.

Windows 10 doesn't seem to contain a "bell.wav" file, at least I couldn't find it searching my system and I don't see it in C:\Windows\Media. Maybe try "ding.wav" instead?

-Greg

new topic     » goto parent     » topic index » view message » categorize

11. Re: Play WAV file in Win10 with Eu 3

ChrisB said...

So, is it right then, that there is no embedded way of playing a sound in Eu 4.x, apart from loading a library to do it? No playsound() equivalent?

There never has been. Playing sounds is an entirely platform-dependent process. For Windows there's PlaySound which is what Win32Lib uses.

On Linux you'd have to use something like GStreamer API which is rather... convoluted due to its dependence on GLib and its messaging loop.

-Greg

new topic     » goto parent     » topic index » view message » categorize

12. Re: Play WAV file in Win10 with Eu 3

With Linux, it's pretty simple:

include GtkEngine.e 
 
constant  
    win = create(GtkWindow,"size=300x300,border=10,$destroy=Quit"), 
    pan = create(GtkBox,"orientation=vertical"), 
    box = create(GtkButtonBox), 
    btn1 = create(GtkButton,"gtk-quit","Quit"), 
    btn2 = create(GtkButton,"audio-player#Play","PlayIt") 
     
add(win,pan) 
add(box,{btn1,btn2}) 
pack_end(pan,box) 
 
show_all(win) 
main() 
 
global function PlayIt() 
 system("""aplay "/home/irv/Downloads/surely_a.wav" &""") 
 -- Robert Hays: "Surely you can't be serious." 
 -- Leslie Nielsen: "I am serious. And don't call me 'Shirley.' " 
return 1 
end function 
new topic     » goto parent     » topic index » view message » categorize

13. Re: Play WAV file in Win10 with Eu 3

irv said...

With Linux, it's pretty simple:

global function PlayIt() 
 system("""aplay "/home/irv/Downloads/surely_a.wav" &""") 
 -- Robert Hays: "Surely you can't be serious." 
 -- Leslie Nielsen: "I am serious. And don't call me 'Shirley.' " 
return 1 
end function 

I'm gonna split hairs with you here and argue that this isn't a good example since you're just launching an executable.

To be honest I focused on GStreamer and forgot about ALSA, but the ALSA API is probably a little simpler to implement.

-Greg

new topic     » goto parent     » topic index » view message » categorize

14. Re: Play WAV file in Win10 with Eu 3

You're correct, but what really is the difference between calling a function in a dll/so vs. executing a script that calls the same function (other than avoiding the complexities of interfacing directly with the dll/so function)?

Other than speed of execution, which isn't a consideration with sounds or videos.

new topic     » goto parent     » topic index » view message » categorize

15. Re: Play WAV file in Win10 with Eu 3

OK, my machines simply go Ding whatever I try and play. But if I remove SND_ASYNC from the flags sent to the PlaySound Windows function, so the program waits for completion, the delay is just what I would expect, but the sound emitted is still just Ding at the start of that time. So the function is opening the WAV file, reads it and knows how long it should be, and then doesn't play it. The WAV file opens ok in Audacity and it plays there, so the data is OK.
So - back to square one: playSound() won't play a WAV file even if it does for M. Duro. I am more confused than ever. Computers - just love 'em, don't you?

new topic     » goto parent     » topic index » view message » categorize

16. Re: Play WAV file in Win10 with Eu 3

ghaberek said...

Just to be clear, we're talking about the Win32Lib playSound() routine, right? This isn't something built into Euphoria? There was only sound() for DOS.

Windows 10 doesn't seem to contain a "bell.wav" file, at least I couldn't find it searching my system and I don't see it in C:\Windows\Media. Maybe try "ding.wav" instead?

-Greg

Yes, standard playSound() which just calls PlaySound which is a windows multimedia routine.
And sorry, you're right, no bell.wav. But I tried some of the other Windows sounds like chimes.wav which is a legit windows tone wav file.

new topic     » goto parent     » topic index » view message » categorize

17. Re: Play WAV file in Win10 with Eu 3

I have no answer as to why some Windows WAV files won't work, but I have found why my own generated speech files wouldn't run.
The file header matched the WAV file specification to a T, but if I opened one in Audacity, played it, and exported it again, the file and data length fields were reduced by 8. They then worked fine in the Euphoria playSound() routine. So I edited my code to reduce those fields by 8 - and Lo and Behold! They played fine.
So though the file length was whatever, I had to tell the WAV header it was 8 fewer. Make sense of that if you can.
And thank you all for your help.

Andy

new topic     » goto parent     » topic index » view message » categorize

18. Re: Play WAV file in Win10 with Eu 3

irv said...

what really is the difference between calling a function in a dll/so vs. executing a script

not much for a ding, but with anything longer stop/mute might be a tad trickier...

new topic     » goto parent     » topic index » view message » categorize

19. Re: Play WAV file in Win10 with Eu 3

AndyDrummond said...

Make sense of that if you can.

I wonder if there's a virus that fits in 8 bytes... getlost

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu