![]() |
Forum Index : Microcontroller and PC projects : Problem playing audio, fails on GUI button press
Author | Message | ||||
astro1 Regular Member ![]() Joined: 26/06/2016 Location: AustraliaPosts: 53 |
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 KingdomPosts: 7889 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |