标签: spotify

Spotify Windows应用程序使用哪些GUI库?漂亮的金属无边框外观?

我觉得windows中的spotify看起来很漂亮,显然不是原生的窗口gui.

看似完全没有金属外观的边框.

我想知道他们用什么库来创建这么漂亮的应用程序?

是否有可能创建一个漂亮的应用程序跨平台(真的很好的Mac和Windows)?

user-interface cross-platform spotify borderless

7
推荐指数
1
解决办法
1901
查看次数

从我的iPhone应用程序打开spotify应用程序

我很确定必须有一种方法从我自己的应用程序启动spotify iphone应用程序.我已经看到SMP应用程序(分享我的播放列表)在将播放列表推入spotify应用程序时做了类似的事情.

我猜应该是这样的:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"spotify://search:muse"]];
Run Code Online (Sandbox Code Playgroud)

如您所见,我希望能够对特定关键字进行spotify搜索.问题是我真的不知道spotify网址方案,如果有这样的东西可用.

我一直在网上搜索,在spotify开发者网站等搜索,但没有出现......

iphone url spotify ios

7
推荐指数
1
解决办法
9278
查看次数

SWIG接口通过函数参数在Java中接收不透明的结构引用

我正在尝试使用SWIG以便为Android使用Spotify API(libspotify):https: //developer.spotify.com/technologies/libspotify/

我无法定义SWIG接口文件以便能够成功调用以下本机C函数:

sp_error sp_session_create(const sp_session_config * config, sp_session ** sess);
Run Code Online (Sandbox Code Playgroud)

在C中将被称为这样:

//config struct defined previously
sp_session *sess;
sp_session_create(&config, &sess);
Run Code Online (Sandbox Code Playgroud)

但在Java中我需要这样称呼它:

//config object defined previously
sp_session javaSess = new sp_session();
sp_session_create(config, javaSess);
Run Code Online (Sandbox Code Playgroud)

sp_session是一个不透明的结构,只在libspotify的API.h文件中定义为:

typedef struct sp_session sp_session;
Run Code Online (Sandbox Code Playgroud)

我期待libspotify库创建它并给我一个引用.那时我唯一需要引用的是传递给API中的其他函数.

我相信答案在于SWIG界面和类型地图,但我尝试应用我在文档中找到示例时未能成功.

java swig spotify

7
推荐指数
1
解决办法
1160
查看次数

SPTPlaylistSnapshot tracksForPlayback返回nil

试图获取用户播放列表中的所有曲目,它可以在Objective-C演示应用程序中运行,但是当我在Swift中尝试时它会返回:

<SPTPlaylistList: 0x7fca22d72460>: 0-0 of 1 items (Function)

我正在使用此代码:

SPTPlaylistList.playlistsForUserWithSession(session, callback: { (error, object) -> Void in
            if error == nil {
                var playlists = object as! SPTListPage
                println(playlists)
                SPTPlaylistSnapshot.playlistWithURI(playlists.items[0].uri, accessToken: session.accessToken, callback: { (error:NSError!, obj) -> Void in
                    var playl = obj as! SPTPlaylistSnapshot
                    println(playl.firstTrackPage.tracksForPlayback)
                })
            }

        })
Run Code Online (Sandbox Code Playgroud)

这是正在运行的Objective-C代码:

[SPTPlaylistList playlistsForUserWithSession:session callback:^(NSError *error, id object) {
    SPTListPage *aa = object;
    NSLog(@"%@",aa.items);
    [SPTPlaylistSnapshot playlistWithURI:[NSURL URLWithString:@"spotify:user:spotifizr:playlist:3bpGFVfycGnhtcEVb95G98"]
                             accessToken:session.accessToken
                                callback:^(NSError *error, SPTPlaylistSnapshot *object) {
                                    NSLog(@"tracks on page 1 = %@", [object.firstTrackPage tracksForPlayback]);

                                }]; …
Run Code Online (Sandbox Code Playgroud)

spotify ios swift

7
推荐指数
1
解决办法
707
查看次数

如何从C#调用Spotify API

我试图用C#调用spotify API.不幸的是,我已经陷入了困境access token

这就是我试图得到它的方式:

private static async Task<string> GetAccessToken()
        {
            SpotifyToken token = new SpotifyToken();

            string postString = string.Format("grant_type=client_credentials");
            byte[] byteArray = Encoding.UTF8.GetBytes(postString);

            string url = "https://accounts.spotify.com/api/token";

            WebRequest request = WebRequest.Create(url);
            request.Method = "POST";
            request.Headers.Add("Authorization", "Basic {Encoded myClientIdXXX:myAppSecretYYY}");
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = byteArray.Length;
            using (Stream dataStream = request.GetRequestStream())
            {
                dataStream.Write(byteArray, 0, byteArray.Length);
                using (WebResponse response = await request.GetResponseAsync())
                {
                    using (Stream responseStream = response.GetResponseStream())
                    {
                        using (StreamReader reader = new StreamReader(responseStream))
                        {
                            string responseFromServer = reader.ReadToEnd();
                            token = …
Run Code Online (Sandbox Code Playgroud)

.net c# web-services spotify

7
推荐指数
2
解决办法
1万
查看次数

Spotify iOS SDK - 从目标节点获取用于 UI/音频可视化的流式 pcm 数据

类似于此 stackoveflow 帖子:通过 Spotify iOS SDK 获取用于可视化的 pcm 音频

我希望按照 Spotify 开发人员在上面的帖子中的建议,在目标节点上添加一个 AudioUnit 回调。

但是,我无法弄清楚如何从目标节点获取 AudioUnit。我一直在研究 Core Audio 及其文档;然而,目前尚不清楚如何在现有 AUNode 中获取对音频单元的引用。

任何帮助,将不胜感激!我的最终目标是根据音频流的功率级别创建反应式 UI。

xcode core-audio spotify ios swift

7
推荐指数
0
解决办法
630
查看次数

在 React 中使用 Spotify Web Playback SDK

Spotify 在测试版中有一项新功能,支持在浏览器中播放完整歌曲,即 Web Playback SDK。该文档显示了使用主 HTML 文件中的脚本标签立即初始化播放器的示例。这需要立即在脚本中设置访问令牌。我的问题是我正在创建一个 React 应用程序,如果用户单击按钮登录到他们的 Spotify 帐户,我只想初始化一个播放器。为了仅在发生此事件时才加载脚本,我使用了 react-load-script。我想要的流程是:用户单击按钮登录他们的 Spotify 帐户,一旦他们的登录通过 Spotify 的身份验证,我的应用程序就会收到一个访问令牌,然后加载网络播放脚本,一旦加载脚本,就会调用回调函数并且播放器使用访问令牌进行初始化。

问题是Spotify对象直到加载了spotify-player脚本才存在。当实际调用handleScriptLoad回调时,定义了Spotify对象,但是在编译代码时却没有。有没有人有任何想法如何解决这个问题?

来自相关 React 组件的代码示例:

import Script from 'react-load-script'

...

handleScriptLoad = () => {
const token = this.props.tokens.access
const player = new Spotify.Player({      // Spotify is not defined until 
  name: 'Spotify Web Player',            // the script is loaded in 
  getOAuthToken: cb => { cb(token) }
})

player.connect()
}

...
Run Code Online (Sandbox Code Playgroud)

在我的 React 组件的渲染方法中:

<Script 
  url="https://sdk.scdn.co/spotify-player.js" 
  onError={this.handleScriptError} 
  onLoad={this.handleScriptLoad}
/>
Run Code Online (Sandbox Code Playgroud)

javascript spotify dynamic-script-loading reactjs

7
推荐指数
1
解决办法
4340
查看次数

Spotify API 字段过滤

我正在尝试使用字段过滤来挑选特定的嵌套字段,在我看来,我遇到了嵌套限制。这是我正在使用的过滤器:items(date_added, track(name, album(artists(name))))

这是我正在尝试的 curl 命令(使用新的开发人员控制台构建):

curl -X "GET" "https://api.spotify.com/v1/users/<user_id>/playlists/<playlist_id>/tracks?fields=items(date_added%2C%20track(name%2C%20album(artists(name))))" -H "Accept: application/json" -H "Content-Type: application/json"

这个调用有效,一切看起来都很好,直到它到达艺术家领域。它似乎没有过滤艺术家领域。在这种情况下,我只想要艺术家的名字。这是我要回来的片段:

"items": [
    {
      "track": {
        "album": {
          "artists": [
            {
              "external_urls": {
                "spotify": "https://open.spotify.com/artist/3t69c5VItBx3GCrnkcYHEL"
              },
              "href": "https://api.spotify.com/v1/artists/3t69c5VItBx3GCrnkcYHEL",
              "id": "3t69c5VItBx3GCrnkcYHEL",
              "name": "Imagined Herbal Flows",
              "type": "artist",
              "uri": "spotify:artist:3t69c5VItBx3GCrnkcYHEL"
            }
          ]
        },
        "name": "Floating"
      }
    }...
];
Run Code Online (Sandbox Code Playgroud)

如您所见,我得到了完整的艺术家对象。有人可以帮助我理解为什么我不能为此过滤字段吗?

spotify

7
推荐指数
0
解决办法
490
查看次数

如何从 Spotify 获取 Oauth 令牌

目前我正在尝试学习如何使用 python 将喜欢的 youtube 视频添加到 Spotify 播放列表中,我正在从https://www.youtube.com/watch?v=7J_qcttfnJA&t=300s学习

在视频的 2 分 18 秒中,她提到使用 Spotify Web API 网站https://developer.spotify.com/documentation/web-api/从 Spotify 添加 userID 和 oauth 令牌

但是,我无法找到 OAUTH 令牌在哪里。

程序员还上传了她从哪里获得令牌的图像,但我似乎找不到它:https ://github.com/TheComeUpCode/SpotifyGeneratePlaylist/blob/master/images/spotify_token.png

python spotify

7
推荐指数
2
解决办法
2万
查看次数

URI 的未定义方法“编码​​”:使用 gem Rspotify 的模块

我正在使用gem rspotify来访问我的 Rails 应用程序中的 Spotify 的 api。Rails 版本是 6.0.4 但最重要的是 Ruby 版本是 3.0.0

当我尝试调用 api 方法时,我不断收到此错误“URI:Module 的未定义方法‘编码’”。我必须强调,当我降级到 Ruby 2.6.3 时,我没有收到此错误。Ruby 3.0.0 似乎不支持 URI 编码。我的用户控制器是下面的代码示例。我收到Spotify_user.country和其他 api 方法的错误。

class UsersController < ApplicationController
  skip_before_action :authenticate_user!, only: [ :spotify]

  def spotify
    spotify_user = RSpotify::User.new(request.env['omniauth.auth'])
    spotify_user.country
  end
end
Run Code Online (Sandbox Code Playgroud)

在config/application.rb中

RSpotify::authenticate(ENV['SPOTIFY_CLIENT_ID'], ENV['SPOTIFY_CLIENT_SECRET'])
Run Code Online (Sandbox Code Playgroud)

在 devise.rb 中,我有

require 'rspotify/oauth'

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :spotify, ENV['SPOTIFY_CLIENT_ID'], ENV['SPOTIFY_CLIENT_SECRET'], scope: 
  'user-read-email playlist-modify-public user-library-read user-library-modify'
end
Run Code Online (Sandbox Code Playgroud)

我想知道是否有一个不涉及降级 ruby​​ 版本的错误解决方案

ruby uri ruby-on-rails urlencode spotify

7
推荐指数
2
解决办法
1万
查看次数