directsound

Writing contents of a DirectSound CaptureBuffer to a WAV file in C#

可紊 提交于 2020-01-05 01:11:38
问题 I have recorded audio to a CaptureBuffer, but I can't figure out how to save it into wav file. I have tried this (http://www.tek-tips.com/faqs.cfm?fid=4782), but it didn't work, or I didn't use it properly. Does anybody know how to solve this? Sample code would be very appreciated. 回答1: A WAV file is a RIFF file consisting of two main "chunks". The first is a format chunk, describing the format of the audio. This will be what sample rate you recorded at (e.g. 44.1kHz), what bit depth (e.g. 16

Writing contents of a DirectSound CaptureBuffer to a WAV file in C#

爱⌒轻易说出口 提交于 2020-01-05 01:11:01
问题 I have recorded audio to a CaptureBuffer, but I can't figure out how to save it into wav file. I have tried this (http://www.tek-tips.com/faqs.cfm?fid=4782), but it didn't work, or I didn't use it properly. Does anybody know how to solve this? Sample code would be very appreciated. 回答1: A WAV file is a RIFF file consisting of two main "chunks". The first is a format chunk, describing the format of the audio. This will be what sample rate you recorded at (e.g. 44.1kHz), what bit depth (e.g. 16

C# resample audio from 8khz to 44.1/48khz

折月煮酒 提交于 2019-12-31 03:30:12
问题 I have encountered a bug in DirectShow .NET where I create a secondary buffer with a sample rate of 8khz, and upon playback, the sound plays back at approx. 8.1khz instead. Googling this, I discovered that I might be forced to upsample the 8khz audio myself to 48khz or 44.1khz depending on the soundcard in the PC. Is there any C# library or generic algorithm I could use for this? Thanks!! Roey 回答1: For Alvas.Audio see code below byte[] data48khz = AudioCompressionManager.Convert(format8khz,

Streaming Data to Sound Card Using C on Windows [closed]

懵懂的女人 提交于 2019-12-23 01:12:58
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . As part of a university project I have to do some signal processing and would like to output the results using the PC sound card. The software has to be written in C and needs to work with Windows (preferably 7 and XP). I have found code examples for outputting .wav and similar files, but I am interested in

Application works in visual studio but release/debug exe does not

五迷三道 提交于 2019-12-13 06:24:23
问题 I am making a game using dx11 . When I compile and run the code in visual studio it works fine however if I try and run the code from the .exe file in either the debug or release folders I got the following error: "Could not initialize direct sound" I have not moved the folders/directories at all. Is this something to do with direct sound not being compatible with dx11 ? If so why would it still run inside visual studio. I am using MS Visual Studio 10. My direct sound class has the following:

Windows Audio and Video Capture Software Paradigm

时光毁灭记忆、已成空白 提交于 2019-12-13 06:16:00
问题 I am writing a program that reads from multiple audio and video devices and writes the data to suitable containers (such as mpeg). I have wrote the code in Linux, but now I have to write another version for windows as well. This is how I wrote it in Linux: initialize the devices (audio: ALSA, video: V4L2) get the file descriptors mainloop select on file descriptors respond to the proper device Unfortunately my expertise is only for Linux and I have never used windows SDK. I don't know what

how to record anything from soundcards?

天大地大妈咪最大 提交于 2019-12-12 08:17:52
问题 i would like to record any sounds produced in my soundcard. please help, where i can get a freeware component or commercial(trial). delphi7/2009 回答1: I have very good experience with the BASS audio library API. Here is a forum thread with C# example, but since the BASS API is procedural and there is a good Delphi API interface, it translates pretty OK. --jeroen 回答2: http://blogs.msdn.com/b/matthew_van_eerde/archive/2008/12/16/sample-wasapi-loopback-capture-record-what-you-hear.aspx might help

SharpDX.SharpDXException when starting audio source - c#

☆樱花仙子☆ 提交于 2019-12-11 16:06:16
问题 When I'm trying to record audio using accord.net, it throws an exception Accord.Audio.DirectSound.pdb not loaded $exception {"HRESULT: [0x88780064], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: Unknown"} SharpDX.SharpDXException I'm using Windows 10 Pro 64 bit with Visual Studio 2017. Accord.Audio - v3.8.0 Accord.Audio.DirectSound - v3.8.0 SharpDX -v2.6.3 SharpDX.DirectSound - v2.6.3 My code is here using Accord.DirectSound; using Accord.Audio; namespace TestAudio { public partial

Gain sole control of Audio Output, DirectSound

有些话、适合烂在心里 提交于 2019-12-11 13:59:22
问题 I am creating a basic signal generator and decided to use my audio card as the analogue output. I chose to use DirectSound because... it seemed like a good option. I have it up and running quite nicely, but I now realize that my code using secondary buffers and as such any other sounds on the computer get mixed in with my generated signal. This is something of an issue, as when I'm running a motor I don't want it to get sent an MSN poke noise as a command. In order to gain total control I've

Set audio input level using portaudio

谁都会走 提交于 2019-12-10 19:48:00
问题 I am dealing with a legacy code that uses portaudio on windows. The code grabs audio from desktop mic and has ability to configure input volume. It worked perfectly under windows xp, but tuning audio input level is broken under windows 7, changing the parameter has no effect on output audio stream. Code do the following to adjust volume mp_mixer = Px_OpenMixer(mp_inputStream, m_dev_num); if(mp_mixer) Px_SetInputVolume(mp_mixer, m_volume); I have discovered, that underling winmme functions