Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:16 13 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Checking to see if a wav file is playing

Author Message
karjo238
Regular Member

Joined: 12/10/2018
Location: New Zealand
Posts: 60
Posted: 04:58am 29 Jul 2019
Copy link to clipboard 
Print this post

Alright, I've got a silly question, and after a bit of searching, I can't seem to find an answer. I want to play a wav file, wait for it to finish, then play another wav file. The second wav file can be different from run to run, so I can't just make it one file.

Is there a variable that can be checked in MMBasic to see if the wav file is playing? There was one called audio_is_playing, but that doesn't seem to work for WAV files.

As always, any help is gratefully appreciated!

Joseph.
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1945
Posted: 05:13am 29 Jul 2019
Copy link to clipboard 
Print this post

Not knowing the platform etc but from the Plus manual.

There is an optional interrupt setting:
PLAY WAV file$ [,interrupt]
The interrupt is called when the file is finished playing.
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
karjo238
Regular Member

Joined: 12/10/2018
Location: New Zealand
Posts: 60
Posted: 11:46pm 29 Jul 2019
Copy link to clipboard 
Print this post

Sorry, I didn't make myself too clear the first time around. I'm using MMBasic 5.04 on a Micromite Extreme 144, and what I really wanted to find out was whether there was a system variable to flag audio (of any kind) playing.


the [,interrupt] option doesn't quite work for what I need, so I was looking (maybe in vain) for another option.

Many thanks,

Joseph.
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1945
Posted: 02:36am 30 Jul 2019
Copy link to clipboard 
Print this post

Sounds like a special situation, my interrupt simply sets a flag, there are a number of places in my Grandfather clock that play different sound files, they all check the playing flag before starting and set it once they start.

I haven't seen any other way mentioned, but Geoff or Peter could answer that definitely.

Mike.
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
karjo238
Regular Member

Joined: 12/10/2018
Location: New Zealand
Posts: 60
Posted: 07:48am 30 Jul 2019
Copy link to clipboard 
Print this post

  KeepIS said  Sounds like a special situation, my interrupt simply sets a flag, there are a number of places in my Grandfather clock that play different sound files, they all check the playing flag before starting and set it once they start.

I haven't seen any other way mentioned, but Geoff or Peter could answer that definitely.

Mike.


Aargh! I wasn't in the right headspace, and you're absolutely right! I made my own flag, and all is well!

Many thanks for giving me a gentle nudge in the obvious direction

Joseph.
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1945
Posted: 09:01am 30 Jul 2019
Copy link to clipboard 
Print this post

Been there done that (all the time lately), that's what's great about these forums, someone usually comes up with something that gives you a nudge towards that OH feeling

Cheers

Mike.
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025