Comments (2)
Alright I've resolved this issue on my end.
I've changed AudioPlayerSample.MusicPlayer's PlaybackStopped to instead be:
public event EventHandler<PlaybackStoppedEventArgs> PlaybackStopped;
In the Open method I've added a new line to the bottom to make:
public void Open(string filename, MMDevice device)
{
CleanupPlayback();
_waveSource =
CodecFactory.Instance.GetCodec(filename)
.ToSampleSource()
.ToMono()
.ToWaveSource();
_soundOut = new WasapiOut() {Latency = 100, Device = device};
_soundOut.Initialize(_waveSource);
if (PlaybackStopped != null) _soundOut.Stopped += PlaybackStopped;
}
As an aside, in AudioPlayerSample.Form1 the constructor has:
_musicPlayer.PlaybackStopped += (s, args) =>
{
btnPlay.Enabled = btnStop.Enabled = btnPause.Enabled = false;
};
This actually results in all buttons being disabled, when perhaps you might prefer for Play to be enabled so they can start again.
from cscore.
Added pull request #33
from cscore.
Related Issues (20)
- Is it possible to process audio based on LUFS scale? HOT 1
- In SpectrumBase.cs ,why " _maxFftIndex = _fftSize / 2 - 1 " ? HOT 4
- Convert a MemoryStream to IAudioSource? HOT 5
- microphone audio as input to another microphone? HOT 1
- Recording on WasapiCapture,a lot of noise. HOT 4
- Duplicate values in AudioSubTypes
- CSCORE AudioClient initializing problem or problem elsewhere? HOT 2
- Which license is intended?
- [Question] peak sound HOT 3
- [Question] Any plans to update it to .NET core/5-6 versions?
- [Question] Getting playback position with WriteableBufferingSource ? HOT 1
- PropertyStore constains not all keys
- Clear WriteableBufferingSource?
- How to prevent WasapiOut to change Device when soundouput changes
- Doesn't build HOT 2
- Is it possible to play audio using RTP Payload?
- Real-time processing left and right channel
- Supported Still? HOT 2
- [QUESTION] Is it possible to run on a Linux server with .Net 8?
- [QUESTION] How to setup a Reverberation in Unity HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cscore.