File tree Expand file tree Collapse file tree
MP3_Playback_RP2040/Pico_I2S_WAV Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""
22CircuitPython I2S MP3 playback example.
3- Plays a single MP3 once.
3+ Plays an MP3 once.
44
55Remove this line and all of the following docstring content before submitting to the Learn repo.
66
Original file line number Diff line number Diff line change 11"""
22CircuitPython I2S WAV file playback.
3- Plays a WAV file for six seconds, pauses
4- for two seconds, then resumes and plays
5- the file to the end.
3+ Plays a WAV file once.
64
75Remove this line and all of the following docstring content before submitting to the Learn repo.
86
1513* WORD_SELECT_PIN
1614* DATA_PIN
1715"""
18- import time
1916import audiocore
2017import board
2118import audiobusio
2724
2825print ("Playing wav file!" )
2926audio .play (wav )
30- t = time .monotonic ()
31- while time .monotonic () - t < 6 :
32- pass
33-
34- print ("Pausing!" )
35- audio .pause ()
36- time .sleep (2 )
37- print ("Resuming!" )
38- audio .resume ()
3927while audio .playing :
4028 pass
4129print ("Done!" )
Original file line number Diff line number Diff line change 11"""
22CircuitPython I2S WAV file playback.
3- Plays a WAV file for six seconds, pauses
4- for two seconds, then resumes and plays
5- the file to the end.
3+ Plays a WAV file once.
64"""
7- import time
85import audiocore
96import board
107import audiobusio
1613
1714print ("Playing wav file!" )
1815audio .play (wav )
19- t = time .monotonic ()
20- while time .monotonic () - t < 6 :
21- pass
22-
23- print ("Pausing!" )
24- audio .pause ()
25- time .sleep (2 )
26- print ("Resuming!" )
27- audio .resume ()
2816while audio .playing :
2917 pass
3018print ("Done!" )
You can’t perform that action at this time.
0 commit comments