mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #354] audio analysis features #205
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#205
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TheVitagor on GitHub (Feb 18, 2019).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/354
Hello, is there any way to get a deep audio analysis with these tools? I mean, can you get a time evolution of, for example, the timbre or loudness like you can do with the Spotify API?
Thank you.
@philknock commented on GitHub (May 9, 2019):
Hello,
I'm new to Spotipy and am interested in this too. This is what I've found out about it so far, I hope this is helpful.
Spotipy provides you everything that the Spotify API does through function calls.
You can use the audio_analysis and audio_features functions to get detailed audio information about a particular track.
These functions contain longs data strings used to describe various attributes track as it evolves over time. I'm not sure if there are functions available to parse this data, but that might be up to you the developer.
I've found two documentation resources that provide a little more info on these data strings
https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-analysis/
http://docs.echonest.com.s3-website-us-east-1.amazonaws.com/_static/AnalyzeDocumentation.pdf
Hope this helps!
@markkohdev commented on GitHub (May 16, 2019):
Hey @TheVitagor and @philknock the audio analysis data is available through the spotipy client - https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_analysis
You can see some usage examples of this functionality here - https://github.com/markkohdev/spotify-api-starter
@kinmeng commented on GitHub (Aug 1, 2019):
Hey @philknock @markkohdev @TheVitagor , I am new to the spotify API and Spotipy. I have read the documentation that you all have suggested and haven't found any solutions to my problem yet so I thought I'd ask here. I've tried the audio_analysis method call like as stated here: https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_analysis .
However, it returns a long string of output as you've said. For a single song, the term 'timbre', for example appeared about 620 times. What could be the issue with my code? If that's the intended output, how can I extract the key results from the long string of output?
My minimum reproducible code for the said long output can be found here: https://stackoverflow.com/questions/57290869/am-i-calling-spotify-apis-method-for-audio-analysis-correctly/57291434?noredirect=1#comment101105442_57291434
Any help is appreciated. Thanks!
@markkohdev commented on GitHub (Aug 13, 2019):
Hey @kinmeng, I don't think it's a problem with your code -- The audio analysis data returned by spotipy is documented in the spotify API reference.
It's essentially a big JSON string containing low-level information which breaks down the track into "beats", "bars", "audio segments" etc along with some extra information about those time windows. What you do with that information is up to you :) (Side note: Ignore the codestring, it's not really useful for end-users and we should probably strip it from the audio analysis response tbh).
Hopefully this answers your question!
@stephanebruckert commented on GitHub (Jan 12, 2020):
Answered by @markkohdev, thanks. This
codestringis also returned in the web API https://developer.spotify.com/console/get-audio-analysis-track/?id=06AKEBrKUckW0KREUWRnvT