Closed hasezoey closed 3 months ago
@tramhao should i try fixing this (with current dev a84b0c59e414965aeab85824a3c7287ae1dd4f27), or do you want to try?
(i ask to not do duplicate work and interfere)
Which problem you're referring to?
this issue #242 (but likely it would also include #238)
I'm still trying to fix #238. For #242 I don't know if you have better ideas. Currently still two stream opened.
I fixed #238. I'll merge it into master. Please start from master. Thanks so much!
i have made a initial implementation, some clean-up and extra tests pending (i only have the test in mod tests
and tested only one station), also need to handle the case where there is no icy-metadata.
commit: https://github.com/hasezoey/termusic/commit/3378a50c834d22f4196368f50a1b822ddf207530
if you want you can try it and report back any problems you have had (i will stop here for today)
I merge the fixes. Meanwhile, I found the metadata parsing could have problem. For the stations I used, before I could get the music title, but now I cannot. The link is as below:
http://war.str3am.com:7780/WUISRIS-2
https://live.musopen.org:8085/streamvbr0
I merge the fixes. Meanwhile, I found the metadata parsing could have problem. For the stations I used, before I could get the music title, but now I cannot. The link is as below:
as a note, please dont merge branches or changes from my fork unless there is a PR. i had explicitly noted that i need to do more testing and do cleanup and would appreciate some testing if wanted (not having it merged yet).
For the stations I used, before I could get the music title, but now I cannot. The link is as below:
for http://war.str3am.com:7780/WUISRIS-2
i dont see any metadata being set, the interval is 1600
, but the length is either 0 or has StreamTitle='';
and never any actual text. (i played it for about 20 minutes).
(i also tested this stream with the same behavior on 684624439c3af90e5a1edf0ed709571c61aa1f2b(before the 1 stream change) and 04c6ff5040769247d24c9c06d2dde67355852472(before going to stream-download or any recent radio changes)
and https://live.musopen.org:8085/streamvbr0
just works, in my case it instantly (within 5 seconds) got StreamTitle='Glenn Gould, Leonard Bernstein, New York Philharmonic - Piano Concerto No. 2 in B Flat Major, Op. 19 - III. Rondo (Molto allegro)';
also i added a small fix that uses icy-description
(if present) for the radio title until the title metadata can be found and will be set
Rusty backend currently opens 2 streams, one for the actual audio data and one for audio data + icy metadata, meaning there are 2 active streams doing the same thing, but just doing one audio data + icy metadata would mean filtering out the metadata as symphonia does not directly handle it.
stream 1, used for symphonia: https://github.com/tramhao/termusic/blob/04c6ff5040769247d24c9c06d2dde67355852472/stream/src/http.rs#L46-L50
streams 2, used for metadata: https://github.com/tramhao/termusic/blob/04c6ff5040769247d24c9c06d2dde67355852472/stream/src/http.rs#L72-L76
maybe related #238