Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:15 19 Jul 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 : Problem playing audio, fails on GUI button press

Author Message
astro1
Regular Member

Joined: 26/06/2016
Location: Australia
Posts: 53
Posted: 10:58am 12 Jul 2025
Copy link to clipboard 
Print this post

If an mp3 or flac file not being played, GUI buttons react and program continues to run.
With either mp3 or flac file playing, pressing a GUI button causes the program to "freeze" with the audio just a sluttering sound. Need to reset.

Running firmware PicoMiteRP2350V6.00.03.

Test code:

OPTION EXPLICIT
OPTION DEFAULT NONE

dim last%, offset%

last%=mm.vres
offset%=int((mm.hres-(int(mm.hres/70)*70))/3)

gui button #6,"menu|MENU",offset%+(70*0),last%-(70*2),70,70,rgb(cyan),rgb(blue)
gui button #8,"pause|PAUSE",offset%+(70*1),last%-(70*2),70,70,rgb(white),rgb(magenta)
gui button #9,"again|AGAIN",offset%+(70*0),last%-(70*3),70,70,rgb(black),rgb(cyan)

'play flac "b:/music.flac"
play mp3 "b:/movie.mp3"
'PLAY TONE 500, 500 : PAUSE 2000
do
text 10,10, time$
pause 100
loop
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7889
Posted: 11:28am 12 Jul 2025
Copy link to clipboard 
Print this post

I'm not sure that there's a satisfactory answer to this. The GUI uses an interrupt to detect a button press and PLAY SOUND depends on an interrupt. You can't delay PLAY SOUND with anything or there's a risk of breaking the sound up as a minimum.

{Mick sits back with popcorn to wait for further replies...}
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
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