Comments (2)
It looks like perhaps the device doesn't support single-channel. The AudioCapture
component takes an optional AudioCaptureConfiguration
with a WaveFormat
which defaults to 16KHz, 1 channel, 16-bit PCM. You could try passing a config with different settings.
I'm not sure how to query the hardware for this, but one possible way would be to record a clip with arecord
and then look at file details with mediainfo
which does show the sampling rate, channel count, etc.
from psi.
I think you are pointing in the right direction...
respeaker@E3BC1:~$ arecord -Dhw:0,0 -f S16_LE -r 16000 -c 1 hello.wav
Recording WAVE 'hello.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
arecord: set_params:1305: Channels count non available
When I use stereo, it works fine...
respeaker@E3BC1:~$ arecord -Dhw:0,0 -f S16_LE -r 16000 -c 2 hello.wav
Recording WAVE 'hello.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Stereo
^CAborted by signal Interrupt...
But using two channels produces another error... but interestingly not an exception. it just prints "Seqmentation faul" to the console and stops...
respeaker@E3BC1:/mnt/Test$ ./ConsoleApp3
Please enter the device name
plughw:0,0
Please enter the sampling rate
16000
Please enter the channel count
2
Segmentation fault
respeaker@E3BC1:/mnt/Test$
Here is the code from my test app (xxx is a SimpleConsumer that does nothing else than printing a message to the console in "Receive"):
using (var pipeline = Microsoft.Psi.Pipeline.Create())
{
//var devices = AudioCapture.GetAvailableDevices();
//foreach (var device in devices)
//{
// Console.WriteLine(device);
//}
//Console.ReadLine();
//audioCaptureConfiguration.OptimizeForSpeech = true;
//audioCaptureConfiguration.OutputFormat = Microsoft.Psi.Audio.WaveFormat.Create16kHz1Channel16BitPcm();
var audioCaptureConfiguration = new Microsoft.Psi.Audio.AudioCaptureConfiguration();
Console.WriteLine("Please enter the device name");
audioCaptureConfiguration.DeviceName = Console.ReadLine();
Console.WriteLine("Please enter the sampling rate");
var samplingRate = int.Parse(Console.ReadLine());
Console.WriteLine("Please enter the channel count");
var channelCount = int.Parse(Console.ReadLine());
audioCaptureConfiguration.Format = Microsoft.Psi.Audio.WaveFormat.CreatePcm(samplingRate, 16, channelCount);
using (var audioCapture = new Microsoft.Psi.Audio.AudioCapture(pipeline, audioCaptureConfiguration))
{
var audioInput = (Microsoft.Psi.IProducer<Microsoft.Psi.Audio.AudioBuffer>)audioCapture;
audioInput.PipeTo(new xxx(pipeline));
//pipeline.Run();
using (pipeline.RunAsync())
{
Console.ReadLine();
}
}
}
What does Seqmentation fault mean?
Perhaps this could help...
https://stackoverflow.com/questions/48588513/segmentation-fault-in-alsa-capturing-example
from psi.
Related Issues (20)
- Feature request: Pause a pipeline HOT 11
- FFmpeg probelm HOT 2
- Question about "FFMPEGMediaSource.cs" HOT 2
- Request to make Microsoft.Psi.MixedReality.StereoKitTransforms properties public HOT 3
- Troubles with RemoteImporter HOT 6
- Will the implementation of "Continual Learning about Objects in the Wild: An Interactive Approach" be opensource? HOT 2
- PSI on Oculus Quest (Android) HOT 4
- Publicizing StereoKitTransforms properties HOT 1
- `NullReferenceException` in MixedReality.cs HOT 1
- Thread-safety bug for the pipeline's stopping state HOT 1
- HoloLens 2 ir cam intrinsics HOT 4
- Fix missing project Microsoft.Psi.Audio.Windows in solution HoloLensCapture.sln
- \psi Studio's 3D panel not rendering properly when using the integrated GPU (but ok with an external monitor) HOT 1
- [Bug]: Hitting an exception when attempting to start hololenscaptureapp in hololens2 using VS2022 HOT 5
- Memory usage of SharedImagePool keeps growing HOT 3
- Poor Serialization Performance for the Diagnostics's `TrackMessageSize` HOT 4
- [Question] Subpipline stop without stopping parent pipline HOT 5
- .NET Native Support
- PsiStoreReader has an inconsistent output for indexed entries on different projects (DotNet vs. UWP) same x64 architecture HOT 2
- Could not load file or assembly 'Microsoft.Psi.Media_Interop.Windows.x64, Version=0.18.72.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. HOT 2
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 psi.