markjamesm / MusicSharp

MusicSharp is a lightweight TUI music player written in C#.
https://markjames.dev/blog/developing-a-cli-music-player-csharp/
GNU General Public License v3.0
57 stars 11 forks source link

Implement Audio Streaming Capability #1

Closed markjamesm closed 3 years ago

markjamesm commented 4 years ago

Need to create an open stream dialog box which allows users to type or copy/paste in an audio stream to play. Method OpenStream(url) will be used to play streams.

This method will need exception handling for non-existent files.

markjamesm commented 4 years ago

This issue discussion for NAudio looks like a good jumping off point. Need to test this code as a proof of concept:

var url = "http://media.ch9.ms/ch9/2876/fd36ef30-cfd2-4558-8412-3cf7a0852876/AzureWebJobs103.mp3"; using(var mf = new MediaFoundationReader(url)) using(var wo = new WaveOutEvent()) { wo.Init(mf); wo.Play(); while (wo.PlaybackState == PlaybackState.Playing) { Thread.Sleep(1000); } }

markjamesm commented 3 years ago

This feature has been implemented already, closing this issue now.

For the copy/paste stream bug, please refer to #19