Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: FLAC routines similar to Pygame  (Read 284 times)

0 Members and 1 Guest are viewing this topic.

rtp_burnsville

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:Today at 12:57:35 pm
  • I want to build my own arcade controls!
FLAC routines similar to Pygame
« on: September 14, 2021, 12:14:33 pm »
Hi,

Does anyone happen to know of some FLAC routines for playing FLAC files using Python? 

I am writing a Jukebox program using Python and it currently uses Pygame for MP3 files.  My music library is FLAC files so would like to directly access those for higher quality music playback.  Have searched for days and not finding much of anything useful to get me started.

Thanks

10yard

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 30
  • Last login:Today at 01:26:51 pm
  • L BREAK into program
    • DKAFE Frontend
Re: FLAC routines similar to Pygame
« Reply #1 on: September 14, 2021, 06:21:28 pm »
Hi,

Does anyone happen to know of some FLAC routines for playing FLAC files using Python? 

I am writing a Jukebox program using Python and it currently uses Pygame for MP3 files.  My music library is FLAC files so would like to directly access those for higher quality music playback.  Have searched for days and not finding much of anything useful to get me started.

Thanks

Direct play of FLAC is supported in recent versions of pygame.  I have tested this very simple script with pygame 2.0.12 successfully.  Run the script and press the "any key" to play the FLAC file. 

Code: [Select]
import pygame
pygame.init()

pygame.display.set_mode((640, 480))
pygame.mixer.music.load('foo.flac')

while True:
    for event in pygame.event.get():
        if event.type == pygame.KEYDOWN:
            pygame.mixer.music.play()

    pygame.display.update()

You should update your pygame if you can.  Latest version is  2.0.1.

« Last Edit: September 14, 2021, 06:27:10 pm by 10yard »
Check out my Donkey Kong Arcade Frontend at https://github.com/10yard/dkafe#readme

rtp_burnsville

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:Today at 12:57:35 pm
  • I want to build my own arcade controls!
Re: FLAC routines similar to Pygame
« Reply #2 on: September 15, 2021, 11:58:59 am »
Thank you for the information on a Pygame update......  This would be great as I could use most of the current code I have.   I'll check it out.