Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Microphone input
#5
Okay, that was it! Thanks! It works with both versions of the C file; however, the name in the BAS file needs to be adjusted in `Microphone2.h` for your file (... BAS source remains the same). Of course , the QB IDE can't do anything with the C file. The error message only appears because no microphone is connected.

[Image: Audio-funktioniert2025-12-25-170058.jpg]


I tried something similar in a smaller format, where the external h file had to be declared in the BAS file. I'm surprised it works without that here.

Code: (Select All)

Option _Explicit

'In QB64 mit "Declare Library" wie angegeben
Declare Library "D:\Lab\QuickBasic64\Extern-nicht-Basic\Basic-ruft-C\bfibonacci"
  Function fibo& (ByVal N As Integer)
End Declare

Dim As Integer N, rueckgabe
Dim As Single zeitstart, zeitende

Timer On

Cls
Locate 3, 3
Input "Berechnet die Fibonacci-Zahl von: ", N

zeitstart = Timer

Locate 5, 3
rueckgabe = fibo&(N%)
If rueckgabe = -1 Then
  Print "Eingabe zu gross!"
  Sleep: System
Else
  Print Using "Die Fibonacci-Zahl von ## = ###,########"; N; fibo&(N%)
End If

zeitende = Timer

Locate 7, 3
Print Using "Sekunden: ##.#### "; zeitende - zeitstart

End

Code: (Select All)

#include <stdio.h>
#include <stdlib.h>

long fibo(int n)
{
long x, y;
int i;

//Um bei 3 eine Anzeige von: 1 2 3 zu erreichen
x = y = i = 1;
if (n == 0 || n == 1)
{
return(n);
}
if (n > 40)
{
return(-1);
//sonst Überlauf
}
else while (i < n)
{
x = x + y; y = x - y; i++;
}
return(x);
}
Reply


Messages In This Thread
Microphone input - by Unseen Machine - 12-25-2025, 02:27 AM
RE: Microphone input - by Petr - 12-25-2025, 10:31 AM
RE: Microphone input - by Kernelpanic - 12-25-2025, 02:13 PM
RE: Microphone input - by Petr - 12-25-2025, 02:47 PM
RE: Microphone input - by Kernelpanic - 12-25-2025, 04:35 PM
RE: Microphone input - by Unseen Machine - 12-25-2025, 06:54 PM
RE: Microphone input - by Kernelpanic - 12-25-2025, 07:25 PM
RE: Microphone input - by Petr - 12-25-2025, 07:25 PM
RE: Microphone input - by Petr - 12-25-2025, 07:42 PM
RE: Microphone input - by Kernelpanic - 12-25-2025, 09:10 PM
RE: Microphone input - by Unseen Machine - 12-25-2025, 07:49 PM
RE: Microphone input - by Petr - 12-25-2025, 09:34 PM
RE: Microphone input - by Kernelpanic - 12-25-2025, 11:03 PM
RE: Microphone input - by Petr - 12-25-2025, 11:31 PM
RE: Microphone input - by Kernelpanic - 12-25-2025, 11:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Let's take this input for a spin doppler 0 634 05-07-2022, 02:57 PM
Last Post: doppler

Forum Jump:


Users browsing this thread: 2 Guest(s)