【问题标题】:How to stream from soundcloud without using API In windowsPhone 8 Application?如何在 windowsPhone 8 应用程序中不使用 API 从 soundcloud 流式传输?
【发布时间】:2014-04-17 12:03:22
【问题描述】:

我开发 windows phone 应用程序,我想在不使用声音云 API 的情况下从声音云流式传输音频(我编写此代码

"webBrowser1.NavigateToString("<!doctype html>" + "<html><head><title></title></head><body>" + "<iframe height=\"1000\" src=\"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/125791854\" width=\"1200\"></iframe>" + "</body></html>");" 

和 C# 并在 Xaml 页面中使用 web 浏览器控件,但是当我运行它时,它会加载声音云站点,但音频没有运行。

【问题讨论】:

  • 手机上的 IE 能用吗?
  • 它在网络浏览器控件上运行并且音频没有运行

标签: c# xaml iframe windows-phone-8


【解决方案1】:

试试Background Audio Player,这里是sample,基本上你最终会做的是

new AudioTrack(new Uri("[your soundcloud uri]", UriKind.Absolute), "[Track Name]", "[Artist]", "[Album]", null)

注意事项:

  1. Url 应该类似于:http://api.soundcloud.com/tracks/[trackNo]/stream?client_id=[id]

  2. 您需要等待 PlayerState 更改为轨道就绪,然后调用 .Play(),这是由于后台音频播放器的异步特性造成的。它实际上与代码的其余部分位于不同的进程中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多