Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add namehint argument to music.queue #2750

Merged
merged 2 commits into from Oct 6, 2021

Conversation

Starbuck5
Copy link
Contributor

Successor to #2558, because I was an absolute fool with Git commands.

Follow up to #2497.

Still posting the google text to speech code.

import pygame
from gtts import gTTS
from io import BytesIO

pygame.init()

mp3_fp = BytesIO()
tts = gTTS(f'Hello, this still works.', lang='en')
tts.write_to_fp(mp3_fp)
pygame.mixer.music.load(mp3_fp, 'mp3')
mp3_fp2 = BytesIO()
tts = gTTS(f'Hehehehehe', lang='en')
tts.write_to_fp(mp3_fp2)
pygame.mixer.music.queue(mp3_fp2, 'mp3')
pygame.mixer.music.play()

clock = pygame.time.Clock()
while True:
    clock.tick(100)

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            raise SystemExit

    if not pygame.mixer.music.get_busy():
        pygame.quit()
        raise SystemExit

Copy link
Member

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to go, just like the old PR

@illume
Copy link
Member

illume commented Oct 6, 2021

Seems there's a conflict now.

@Starbuck5
Copy link
Contributor Author

Seems there's a conflict now.

resolved.

@illume illume merged commit 74c9814 into pygame:main Oct 6, 2021
@Starbuck5 Starbuck5 added this to the 2.0.2 milestone Oct 7, 2021
@Starbuck5 Starbuck5 added the mixer.music pygame.mixer.music label Oct 7, 2021
@Starbuck5 Starbuck5 deleted the music-queue-namehint branch February 7, 2023 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mixer.music pygame.mixer.music
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants