Hi again,
I'm now trying to record audio on the raspberry Pi B+ 512 MB.
The same code is running on Windows 10 and it works (I can record audio and playback it afterwards).
Now I'm not sure what I'm doing wrong.
I'm using the ACMFORMAT-Class for the Encoding and the call of the Constructor throws an Exception.
For recording I plugged in an USB Soundcard with an standard mic plugged into that.
The Bass-DeviceInfo differs between Windows 10 and Linux.
So I don't know if the device itself is the problem or the using of the ACMFORMAT.
Thank you!!!
Martin
==== Logged device Info
DeviceInfo Windows 10:
Device 0: Mikrofon (USB PnP Sound Device), usb#vid_0d8c&pid_013c&mi_00#7&25ba7e06&0&0000#{6994ad04-93ef-11d0-a3cc-00a0c9223196}\global, {0.0.1.00000000}.{0a1af7ac-d040-4a6b-b36e-f571675a079d}, BASS_DEVICE_ENABLED, BASS_DEVICE_DEFAULT, BASS_DEVICE_TYPE_MICROPHONE, BASS_DEVICE_ENABLED, BASS_DEVICE_DEFAULT, BASS_DEVICE_TYPE_MICROPHONE
DeviceInfo Linux (Linux raspberrypi 3.12.22+ #691 PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l):
Device 1: USB PnP Sound Device: USB Audio, , hw:1,0, BASS_DEVICE_ENABLED, BASS_DEVICE_NONE, BASS_DEVICE_ENABLED
==== Code
Console.WriteLine("StartRecording");
Console.WriteLine("1 " + Bass.BASS_ErrorGetCode());
// -1 on Windows for my default mic
// 1 on Linux (my Pi) for the USB-Soundcard
if (!Bass.BASS_RecordInit(1))
{
Console.WriteLine("ERROR Init Record " + Bass.BASS_ErrorGetCode());
}
Console.WriteLine("2 " + Bass.BASS_ErrorGetCode());
_myRecProc = new RECORDPROC(RecordingCallback);
Console.WriteLine("3 " + Bass.BASS_ErrorGetCode());
_recHandle = Bass.BASS_RecordStart(44100, 2, BASSFlag.BASS_RECORD_PAUSE, _myRecProc, IntPtr.Zero);
Console.WriteLine("4 " + Bass.BASS_ErrorGetCode());
ACMFORMAT codec = new ACMFORMAT();
Console.WriteLine("5 " + Bass.BASS_ErrorGetCode());
BassEnc.BASS_Encode_GetACMFormat(0, ref codec, "title", 0);
Console.WriteLine("6 " + Bass.BASS_ErrorGetCode());
BassEnc.BASS_Encode_StartACMFile(_recHandle, codec, BASSEncode.BASS_ENCODE_AUTOFREE | BASSEncode.BASS_UNICODE, TempRecFileName);
Console.WriteLine("7 " + Bass.BASS_ErrorGetCode());
Bass.BASS_ChannelPlay(_recHandle, false);
Console.WriteLine("8 " + Bass.BASS_ErrorGetCode());
==== Console-Log
...
StartRecording
1 BASS_OK
2 BASS_OK
3 BASS_OK
4 BASS_OK
Error on Recording, code: BASS_OK
System.EntryPointNotFoundException: BASS_Encode_GetACMFormat
at (wrapper managed-to-native) Un4seen.Bass.AddOn.Enc.BassEnc:BASS_Encode_GetACMFormatUnicode (int,intptr,int,string,Un4seen.Bass.AddOn.Enc.BASSACMFormat)
at Un4seen.Bass.AddOn.Enc.BassEnc.BASS_Encode_GetACMFormat (Int32 handle, IntPtr form, Int32 fromlen, System.String title, BASSACMFormat flags) [0x00000] in <filename unknown>:0
at Un4seen.Bass.AddOn.Enc.ACMFORMAT..ctor () [0x00000] in <filename unknown>:0
at MusicCore.MyPlayer.StartRecording () [0x00000] in <filename unknown>:0
=== DeviceInfo-Logging Code
Console.WriteLine("Device "
+ a + ": "
+ info.name + ", "
+ info.id + ", "
+ info.driver + ", "
+ info.status + ", "
+ info.type + ", "
+ info.flags);