Ajuda:
Oi pessoal, estou tentando criar um Bip com o seguinte código:
import simpleaudio as sa
# Define parameters
frequency = 440 # Hz (frequency of the sound)
amplitude = 1 # Amplitude of the sound (0-1)
duration = 2 # Duration of the sound in seconds
# Create sound wave
wave = sa.WaveObject.from_waveform(
wave_type=sa.WaveForm.SINE,
frequency=frequency,
amplitude=amplitude,
duration=duration,
)
# Play sound
play_obj = wave.play()
# Wait for sound to finish
play_obj.wait_done()
# Create blink (high-pitched, short sound)
blink_frequency = 880 # Hz (frequency of the blink)
blink_duration = 0.1 # Duration of the blink in seconds
blink_wave = sa.WaveObject.from_waveform(
wave_type=sa.WaveForm.SINE,
frequency=blink_frequency,
amplitude=amplitude,
duration=blink_duration,
)
play_obj_blink = blink_wave.play()
play_obj_blink.wait_done()
Está dando esse erro:
File "main.py", line 1
pip install simpleaudioimport simpleaudio as sa
^^^^^^^
SyntaxError: invalid syntax
Tô usando piton para celular.
Podem me dar uma força?