I tried getting the system output device stream buffer using NAudio but I had this problem:
C# Unity 3D NAudio throws NullPointerException while checking for default audio endpoint
The same exact code mentioned in that question works just fine in my windows forms projects(outside Unity).
NAudio would be the perfect solution for me, but it just doesn't want to cooperate with Unity for some reason. So is there any free alternative to NAudio or any other free possible solution for this problem?
I personally have used FMOD to great success, for help on how to integrate into unity you can look at an open source project that utilises it to great effect :) here: https://github.com/OrderOfThePorcupine/ProjectPorcupine.
Related
I am currently working on a solution where i want to livestream from my app. I succesfully get my camerastream working with avfoundation. The next step in order to complete my task is to send my video frames to a rtmp server but I am not sure on how i can accomplish this in xamarin forms ios.
For swift there is a library called https://github.com/jgh-/VideoCore that solves this but do we have something similiar in xamarin (any library) or documentation on examples that tackles this issue?
Thanks a lot!
Maybe it's a bit late for you, but this can probably help someone who wants to do the same thing (like I did), you can use the Xamarin port of LFLiveKit:
https://github.com/rhedgpeth/Xamarin-LFLiveKit
You'll have to implement a custom renderer to use it with forms, but it's not too hard if you follow the sample project in the repository.
I am trying to stream video from my webcam (audio and video) from .NET UWP IOT application.
I tried this WebCamApp sample from https://github.com/ms-iot/samples and it works perfectly. Now I would like to play with streaming that video to another PC/device. I am open to your suggestions on how to approach this. In past I was dealing with RTSP, but not on this platform. So far I saw that limitation is the .NET Core.
Are there any libraries for this? Or should i write something from scratch? What are your suggestions?
I don't have a complete solution, but what you're looking for is real time streaming. and I recommend using WebRTC.
WebRTC is a project built by google to support real time communication, you can play around with the sample from this website:
https://www.webrtc-experiment.com/
I found also this port for UWP, applications. But I'm not sure if it works with IOT:
https://www.nuget.org/packages/WebRTC/
I have been attempting to get this working for a while and am a bit stuck.
I am attempting to be able to play a video in C# using libavcodec outputting to DirectX and either DirectSound or XAudio2. I have managed to get it to play a video, but am stuck on getting it to output sound.
It doesn't help that I have had no experience with either of DirectSound or XAudio2, or that libavcodec has little documentation. I have managed to get the audio codec, but am stuck trying to decode it or output it through DirectSound/XAudio2.
If anyone is able to either point me in the right direction, or just tell me how to do it I would be grateful.
I am currently doing approximately the same thing as you and am also stuck at the same point! All I can tell you for now is, if you haven't found it, there's a good tutorial showing how to do it with SDL at An ffmpeg and SDL Tutorial, using SDL_Audio for audio playback.
I am looking to see how to adapt this for XAudio2 or DirectSound and if I find anything more I'll let you know. Am currently reading through the official XAudio2 documentation at MSDN.
Good luck!
I recently found a way to convert video's through the FFMpeg converter through command line, but ive recently been interested in making a video player! and i heard that VLC player and various other systems use FFPlay, and i dont know anything about it! so i have some main points of interest..
Questions:
What exactly does the ffplay.exe do?
If it allows me to stream videos, how would i create an interface to C# to use that
How would i display the video on a windows forms app.
If one of those is not possible, im welcome to other alternatives.. or even perhaps writing my own. Suggestions welcome! :)
Edit: im looking for possible solutions with a framework requirement of 3 or below, and also would perfer to not make them install anything additional to my program.
I am not expert but based on what I know,
You can perhaps look at DirectShow technology for developing your video player as there are managed lib such as directshow.net available for it.
To my knowledge, FFPlay is GUI on top of FFmpeg libraries - the main part of FFmpeg is audio/video codec library supporting many formats including MPEG-4 implementation.
To use FFmpeg via DirectShow, you need another component known as ffdshow.
Does XNA provide a means of audio input from the line-in? I looked at the MSDNA website but can't find anything on audio input. If it is indeed possible, a snippet of code or a tutorial website would be great.
Edit:
I need to do buffered reads from the audio-line in. I'm not so much interested in the implementation but rather if it has low latency.
Also development will be implemented into a PC only game.
I think all sound files need to be compiled by XACT before they can be used in XNA.
So either you get hold of DirectSound and look at the sample in:
\Samples\Managed\DirectSound\CaptureSound
...or you could interop with winmm.dll. This guy has made a small example of how to do it:
http://www.codeproject.com/KB/audio-video/cswavrec.aspx
And this guy writes some more about enumerating all sound recording devices:
http://www.codeproject.com/KB/cs/Enum_Recording_Devices.aspx
Hope it helps!
Edit:
I'm not sure what you want to do with your audio stream so this tutorial might be of interest as well:
http://nyxtom.vox.com/library/post/recording-audio-in-c.html
Edit 2:
What he said (in the comment)
|
|
V
If you're looking at doing a Windows only project, you could certainly capture the audio coming in with code from outside the XNA framework and play it back with the same. Because of how the XNA content manager works, you wouldn't be able to use the regular playback methods because the content manager translates everything into .xnb files at compile time and reads them from there. Nothing keeping you from playing using standard windows API calls though. You wouldn't really have an XNA project at that point, but I don't suppose the distinction is all that important since you're not looking to be compatible with the other platforms anyway.
To answer your question, no, you can't access audio line-in through the XNA APIs. You'd have to look at some other library such as Port Audio that would give you access to features like that. But then you'd be restricted to running on windows (ie. no xbox or zune).
disclaimer: not sure if port audio specifically has this functionality as I just found it quickly via google. Was just trying to illustrate that you'd have to use some other API.