mirror of
https://github.com/rkk-2s/bad-apple.git
synced 2026-10-14 21:38:53 +00:00
[GH-ISSUE #9] [touhou_bad_apple_v4.5.py] pygame.error: Unrecognized audio format #7
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rkk-2s/bad-apple#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @0n1cOn3 on GitHub (Jun 10, 2021).
Original GitHub issue: https://github.com/rkk-2s/bad-apple/issues/9
Hey :) Its been a while since my last ticket :)
I have a new one for yaa. Even when this project was a weekend project. im still amazed about your progress..
It seems to be that there is something wrong with the audio format...
see log:
python3 touhou_bad_apple_v4.5.py
Select option:
==============================================================
Your option: 1
Please enter the video file name (file must be in root!): BadApple.mp4
MoviePy - Writing audio in audio.mp3
MoviePy - Done.
Beginning ASCII generation...
Progress: [####################### ] 99% Frame 6570 of 6571 framesASCII generation completed! ASCII generation time: 28.546977519989014Traceback (most recent call last):
File "touhou_bad_apple_v4.5.py", line 181, in
main()
File "touhou_bad_apple_v4.5.py", line 170, in main
play_audio('audio.mp3')
File "touhou_bad_apple_v4.5.py", line 24, in play_audio
pygame.mixer.music.load(path)
pygame.error: Unrecognized audio format
@rkk-2s commented on GitHub (Jun 10, 2021):
Hi there, are you running it specifically for the purpose of Bad Apple or just for a generic video? Also, it would be great if you could tell me what environment you are running this on.
@0n1cOn3 commented on GitHub (Jun 10, 2021):
Specific for the Bad Apple video purpose.
OS: Ubuntu 20.04
Shell: zsh/bash
Python: 3.8.10
pip: 20.0.2
SDL: 2.0.14
@0n1cOn3 commented on GitHub (Jun 10, 2021):
I'm not sure if I understand this correctly:
I see the variable "path_to_file" but the variable in
def play_audio
in
pygame.mixer.music.load()
is set as (path).
Could this not be a problem?
PS: Oh, thats on V3.0 🤦🏻♂️ But same error there.
@rkk-2s commented on GitHub (Jun 13, 2021):
No I don't think that is really the issue, though I have to admit when it comes to naming conventions I am terribly garbage at this. Though, if you wish just to play for Bad Apple, I would recommend that you try v4.0 instead, as it would use a pre-existing audio file instead of extracting it from the .mp4 file.
Not too sure why, but there seems to be some error when it comes to generating the audio file in Linux environments. Might be the
moviepy.editorlibrary requiring some dependencies that Linux lacks. Though I would see if I could resolve the issue on my end.@0n1cOn3 commented on GitHub (Jul 13, 2021):
Version 4.0 spites the same error btw. 🥴🥴
@rudy3333 commented on GitHub (Apr 17, 2022):
Pygame.mixer will not load .MP3 files, because of licensing restrictions. You need to convert them to
.wavor.ogg.Try this online tool.
@0n1cOn3 commented on GitHub (Apr 17, 2022):
Everything is working as now.
It has just at the end a small side effect:
When the video ends, Python spits an error
As mentioned here
@rudy3333 commented on GitHub (Apr 17, 2022):
I'm pretty sure that's normal, because of automatically generated array.
@0n1cOn3 commented on GitHub (May 13, 2023):
Can this be avoided?