idk what im doing at this point with the audio shit
This commit is contained in:
1 parent
6edcd1db98
commit
6897b684ee
4 files changed
+67
-24
No files matched your search
@@ -1,8 +1,46 @@
|
||||
import urwid
|
||||
# import urwid
|
||||
|
||||
txt = urwid.Text("hello world")
|
||||
fill = urwid.Filler(txt, "top")
|
||||
loop = urwid.MainLoop(fill)
|
||||
loop.run()
|
||||
# txt = urwid.Text("hello world")
|
||||
# fill = urwid.Filler(txt, "top")
|
||||
# loop = urwid.MainLoop(fill)
|
||||
# loop.run()
|
||||
|
||||
import wave
|
||||
|
||||
import SubSonic
|
||||
import pyaudio
|
||||
|
||||
u = 'pseudo'
|
||||
p = 'telegram9dock-MICHEL'
|
||||
conn = SubSonic.SubpyConn(u, p, "https://music.0x01fe.net")
|
||||
|
||||
echidna_id = "937004317800a879f0cddd471fb82387"
|
||||
|
||||
def play_song(song_id: str):
|
||||
r = conn.stream(song_id)
|
||||
|
||||
# print(len(r.content))
|
||||
|
||||
stream_data: bytes = r.content
|
||||
|
||||
def callback(in_data, frame_count, time_info, status):
|
||||
|
||||
return (stream_data, pyaudio.paContinue)
|
||||
|
||||
|
||||
|
||||
audio = pyaudio.PyAudio()
|
||||
|
||||
stream = audio.open(format=audio.get_format_from_width(2),
|
||||
channels=2,
|
||||
rate=44100,
|
||||
output=True,
|
||||
stream_callback=callback)
|
||||
|
||||
# r.content.
|
||||
|
||||
# def stream_callback(in_data)
|
||||
|
||||
|
||||
|
||||
play_song(echidna_id)
|
||||
Reference in new issue
Block a user