[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I have spare Raspberry Pi and a project idea in mind but I don't

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 35
Thread images: 1

File: pi.jpg (410KB, 1200x900px) Image search: [Google]
pi.jpg
410KB, 1200x900px
I have spare Raspberry Pi and a project idea in mind but I don't really know where to start with this.

So my idea is that the Pi would play music from spotify 24/7 and record the audio output as mp3 file. Then, when the song ends, it would name that file accordingly like "Artist - Song name" or something, even tagging would be cool but not really neccessary.
How could I do this?

Bonus features like showing the current song on 1602 lcd screen would be cool too.
>>
Not very useful because without premium subscription you will only get like 96kbps
>>
>>58896352
paying premium wouldn't really be problem.
>>
Spotify API for queries (Song info + Playback) and ALSA for recording, I guess. Python for wiring things up and you should be good to go.
>>
>>58896375
If you have premium why do you wanna rip the music anyway?
>>
Start from alsa, record some audio using its api. I guess you can also do that with some python library. You will need Spotify premium for querying and add-free stream. I guess It is also possible to do that without premium, but you will have to do a lot of handwork to get things in place
>>
>>58896511
To have it with me and for the "why not"?
>>
>>58896375
>>58896512
Isn't there a way to grab/rip the direct stream data directly instead of "recording"? Or is this what you mean with ALSA?
>>
>>58896567
I dunno, seems easier to just record it.
>>
>>58896318
Tor exit node.
>>
>>58896581
what do you mean?
>>
>>58896589
My bad. Normally these threads are "what can I do with a raspberry pi"
P.S. your spotify ripping is dumb. Unless you are targeting Spofify exclusive music.
If you can't find the music you want elsewhere then it's properly not worth having.
Fuck install limewire. that's still a working network.
>>
>>58896567
There is no "direct" way, you are in theory limited to what Spotify's APIs and TOS limit to. The thing is, you can bypass it by recording your audio driver output (That's called ripping). Just make a playlist, run it and record your audio. This entire process can be scripted
>>
>>58896615
It's not about finding the music I want to listen, it's more about a dump idea of having all the music. (Yes, this is datahoarding)
>>
>>58896634
Alsa is one of Linux audio drivers.. As I said, you could also find already built audio recording libraries for python. Your project is not that complex, really
>>
Spotify audio is encrypted when sent via streaming, it gets decrypted by your client when it is playing, so no, you can't sniff the network and get the audio. The easiest way is playing the audio and recording it (Keep in mind that if you skip songs, or if it cuts the audio for some reason, your recording may get weird)
>>
>>58896633
Ok, is there a quality loss then? Or is this bytewise the original stream?
>>
It is the same as the stream (96kbps). If you have Spotify premium (You'll need it for querying the API), you can change it to a higher quality.
>>
>>58896838
>Or is this bytewise the original stream?
If you record it losslessly, yes.
>>
>>58896352
With a free account, the highest quality you can get is 160kbps Vorbis.
>>
>>58896633
>There is no "direct" way, you are in theory limited to what Spotify's APIs and TOS limit to.
>The thing is, you can bypass it by recording your audio driver output
???
how would directly capturing it be a higher bitrate?
the information never exists regardless of how many samples and how many bits you use to sample the lossy stream
>>
>>58896978
He meant directly recording it, he wasn't talking about bitrate
>>
>>58897048
directly recording from where
>>
>>58897072
the bitstream from spotify.

Winamp used to have a plugin called "streamripper" where you could actually capture the original bytestream in original quality.
>>
>>58897123
why would the bitstream from spotify be higher quality than the 96kbps from wherever
that would waste so much bandwidth
>>
>>58897072
I'm talking about directly recording your audio using some software, like audacity. The difference is that instead of recording your microphone, you record what is currently playing on the ouput of your soundcard.
>>
>>58897157
what are you on about
>>
>>58897190
http://manual.audacityteam.org/man/tutorial_recording_audio_playing_on_the_computer.html

The idea is playing audio from Spotify and recording it using the method above.

This process can be scripted, and it is also what OP's looking for (So it can be used 24/7 by the RPi).

To script it, you will need to access Spotify APIs (That way you can invoke calls to Spotify's audio player, like Play, Stop, Skip, Get Track info, etc)

Second, you will have to record the audio just like audacity does, but, as there isn't any audacity apis (That I'm aware of), you should use other method to do so. Python has a multitude of libraries to do anything that you could possible imagine, recording audio is one of those things.

Refer to https://wiki.python.org/moin/Audio/ to get more info.

Third, you write a python script that wires everything up (Query api, record audio, save to disk) and it should be gold.
>>
>>58897341
Then if you want to print the stuff to an LCD, you just have to get the file name that is on disk (Or you could also query the API), and do the hardware related stuff to setup it. Easy stuff
>>
>>58897341
>The idea is playing audio from Spotify and recording it using the method above.
this will be higher quality than what spotify gives you how?
>>
It's à good idea with the raspberry pi, but how could you write the title of each song ?
Years ago, Radio blog record song on radio et can download them ^^
>>
>>58897394
The audio quality that is streamed from Spotify is one thing, the quality that the recording will be stored by audacity/python is other thing. You can have a FLAC quality coming from spotify, and a recording of 32kb. In the end it will be bad.

If you pay spotify premium, you can increase the audio quality and get, lets say, 320kb, that way, you setup audacity/whatever to store at 320kb and it work as intended.
>>
>>58897450
https://developer.spotify.com/web-api/

There are sample applications on the docs
>>
PS: Keep in mind that all of these stuff is breaking Spotify Terms of Service.. Do it on your own risk!
>>
There is a wrapper to the Spotify's API written in python.

https://github.com/plamere/spotipy

50% done.
Thread posts: 35
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.