Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made an F# version of the example in https://github.com/naudio/NAudio/blob/master/Docs/PlayAudioFromUrl.md #1181

Open
Ytrog opened this issue Sep 13, 2024 · 0 comments

Comments

@Ytrog
Copy link

Ytrog commented Sep 13, 2024

Hello,

I made an F# version of the code in https://github.com/naudio/NAudio/blob/master/Docs/PlayAudioFromUrl.md so I can easily listen to a certain radio-station on commandline. It might be of interest for documentation purposes:

open NAudio.MediaFoundation
open NAudio.Wasapi
open NAudio.Wave
open System.Threading


let url = "https://ice1.somafm.com/groovesalad-128-aac"

printfn "Starting Groove Salad Playback"

let start () =
    use mf = new MediaFoundationReader(url)
    use wo = new WasapiOut()

    wo.Init(mf)
    wo.Play()

    while true do
        Thread.Sleep 1000


start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant