Recent Posts

Pages: [1] 2 3 ... 10
1
Programs / Re: Spriggsy's API Collection
« Last post by SpriggsySpriggs on Today at 01:31:31 AM »
Added source to show a waveform of the recording made with mciSendStringA. It uses ffmpeg to show a waveform from the wav file that is created. Here is a screenshot of a waveform I made from a recording:

 
2
QB64 Discussion / Re: Recording Audio in QB64?!?!
« Last post by SpriggsySpriggs on Today at 01:26:54 AM »
@Richard I never have been able to get that to work with any video. I'm not sure what the requirements are for codecs but I've never seen it work. I'd love to have videos play in QB64 but no luck for me.
3
QB64 Discussion / Re: Recording Audio in QB64?!?!
« Last post by Richard on Today at 01:25:57 AM »
Any use?

Quote

DECLARE DYNAMIC LIBRARY "WINMM"
    FUNCTION mciSendStringA% (lpstrCommand AS STRING, lpstrReturnString AS STRING, BYVAL uReturnLength AS INTEGER, BYVAL hwndCallback AS INTEGER)
    ' mciSendStringA function plays media files and returns the following:
    ' 0 = command sucessful
    ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ' lpstrCommand is the MCI command string (and optional flags) to send.
    ' lpstrReturnString is a string that holds any return information.
    ' uReturnLength is the length of the lpstrReturnString string passed.
    ' NOTE: If lpstrCommand given doesn't retun a value then lpstrReturnString
    '       can be empty and uReturnLength can be set to 0.
    ' hwndCallback contains a callback window handle (only if the Notify flag used in lpstrCommand)
    '====================================================================
    FUNCTION mciGetErrorStringA% (BYVAL dwError AS INTEGER, lpstrBuffer AS STRING, BYVAL uLength AS INTEGER)
    ' mciGetErrorStringA returns error info if the mciSendStringA failed.
    ' dwError is the return value from the mciSendString function.
    ' lpstrBuffer string holds the error information returned by the function.
    ' uLength is the length of the lpstrBuffer string buffer.
    '====================================================================
END DECLARE

DECLARE CUSTOMTYPE LIBRARY
    FUNCTION FindWindow& (BYVAL ClassName AS _OFFSET, WindowName$)
END DECLARE


handle& = _NEWIMAGE(800, 600, 256)
SCREEN handle&


_TITLE "QB64 Video"
hwnd& = FindWindow(0, "QB64 Video" + CHR$(0))

ReturnString$ = SPACE$(255)
ErrorString$ = SPACE$(255)
filename$ = "c:\DavPiano.mpg" '<========== video file to play

a% = mciSendStringA%("open " + filename$ + " style popup", ReturnString$, LEN(ReturnString$), 0)

IF a% THEN
    x% = mciGetErrorStringA%(a%, ErrorString$, LEN(ErrorString$))
    PRINT ErrorString$
    END
ELSE
    a2% = mciSendStringA%("window " + filename$ + " handle " + STR$(hwnd&), ReturnString$, LEN(ReturnString$), 0)
    b% = mciSendStringA%("play " + filename$, "", 0, 0)
    _SCREENMOVE _MIDDLE
    '=== Play video...
    DO: _LIMIT 30: LOOP UNTIL INKEY$ <> ""

    x% = mciSendStringA%("stop " + filename$, "", 0, 0)
    x% = mciSendStringA%("close " + filename$, "", 0, 0)
END IF
4
QB64 Discussion / Re: Recording Audio in QB64?!?!
« Last post by FellippeHeitor on Today at 01:21:58 AM »
Done. Right now I'm adding another bit of functionality to the sound API by allowing it to show a waveform using ffmpeg :)

 


That's cool!
5
QB64 Discussion / Re: Recording Audio in QB64?!?!
« Last post by SpriggsySpriggs on Today at 01:17:15 AM »
Please be sure to give a shout out to visionmercer, too. I got it working almost fully, except it would only work once. visionmercer pointed me to the SetWindowPos function, which I fiddle with a bit and got it to do the trick.

Done. Right now I'm adding another bit of functionality to the sound API by allowing it to show a waveform using ffmpeg :)

 
6
QB64 Discussion / Re: Recording Audio in QB64?!?!
« Last post by Pete on Today at 01:15:34 AM »
Please be sure to give a shout out to visionmercer, too. I got it working almost fully, except it would only work once. visionmercer pointed me to the SetWindowPos function, which I fiddle with a bit and got it to do the trick. I love that about forums; an abundance of resources and knowledge.

Pete
7
Programs / Re: Spriggsy's API Collection
« Last post by SpriggsySpriggs on Today at 01:07:27 AM »
Updated 1:06 AM on 09/27/2020

Added SetWindowPos and GetForegroundWindow from User32 WinAPI, courtesy of Pete and visionmercer. Original post here:https://www.qb64.org/forum/index.php?topic=1365.msg105588#msg105588

This function allows the running program to be the topmost program even when clicking elsewhere on the screen.
8
QB64 Discussion / Re: Recording Audio in QB64?!?!
« Last post by SpriggsySpriggs on Today at 01:03:55 AM »
Hey thanks for adding the sound API. Nice collection. I don't know if you have a windows persistency API, but you are welcome to test and add mine to the mix. https://www.qb64.org/forum/index.php?topic=1365.msg105588#msg105588

That's pretty neat that it is able to stay topmost! That's nice, especially in Windows 10 where I seem to constantly have an issue where sometimes the window goes to the background when my mouse moves away from it. I'll add it to my collection and credit you.
9
QB64 Discussion / Re: Recording Audio in QB64?!?!
« Last post by Pete on Today at 12:59:19 AM »
Good. I agree, just a small problem. If it were a big one, you'd have to try %90 :D

Hey thanks for adding the sound API. Nice collection. I don't know if you have a windows persistency API, but you are welcome to test and add mine to the mix. https://www.qb64.org/forum/index.php?topic=1365.msg105588#msg105588

Pete
10
QB64 Discussion / Re: Recording Audio in QB64?!?!
« Last post by SpriggsySpriggs on Today at 12:39:49 AM »
Ah, of course it was something extremely simple. A space in my directory path. It needed to be substituted with %20, of course. Made it work right away. Neato.
Pages: [1] 2 3 ... 10