PureBasic & LibVLC

This forum is about all development around libVLC.
collectordave
New Cone
New Cone
Posts: 4
Joined: 23 Sep 2021 06:05

PureBasic & LibVLC

Postby collectordave » 23 Sep 2021 06:34

Hi all

New to the forum and to libvlc. Sorry if posted in the wrong place please move if necessary.

I am using a Mac m1 24 running Big Sur.

I use a language called PureBasic.

I am attempting to produce a LibVlc module for use in pureBasic to play audio.

So far I have VLC Version 2.2.8 Weatherwax (Intel 64bit) installed which plays any audio file I drop on it .ogg and MP3.

Which to me seems strange as I am on an M1 machine using the Apple silicon.

To start I would like to play a single song file and know when it has finished.

My code so far is:-
libVlc = GetUserDirectory(#PB_Directory_Documents) + "VlcTRY/VLC.app/Contents/MacOS/lib/libvlc.dylib"
SetEnvironmentVariable("VLC_PLUGIN_PATH", GetUserDirectory(#PB_Directory_Documents) + "VlcTRY/VLC.app/Contents/MacOS//plugins/")

hlib = OpenLibrary(#PB_Any, libVlc)

m_pVLCInstance = CallCFunction(hlib, "libvlc_new", 0, #Null)

m_pMediaPlayer = CallFunction(hlib, "libvlc_media_player_new", m_pVLCInstance)

Debug m_pVLCInstance
Debug m_pMediaPlayer
Both debugs return large numbers, no zeros.

Where do I go from here?

Any help appreciated.

collectordave
New Cone
New Cone
Posts: 4
Joined: 23 Sep 2021 06:05

Re: PureBasic & LibVLC

Postby collectordave » 24 Sep 2021 16:53

Making progress.

Another user on the PureBasic forum is showing the way and I can now play an audio file no bother even changing the playback volume!

Just a question.

I have split off the libs and plugins from the app, everything works fine is this allowed?

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: PureBasic & LibVLC

Postby mfkl » 27 Sep 2021 04:16

I have split off the libs and plugins from the app, everything works fine is this allowed?
Not sure what you mean by that but why wouldn't it be?

I doubt many people here are familiar with purebasic tbh, but libvlc yes. Try to familiarize yourself with the docs https://videolan.videolan.me/vlc/group__libvlc.html and samples https://www.videolan.org/vlc/libvlc.html
https://mfkl.github.io

collectordave
New Cone
New Cone
Posts: 4
Joined: 23 Sep 2021 06:05

Re: PureBasic & LibVLC

Postby collectordave » 27 Sep 2021 05:01

Thanks for the reply
I have split off the libs and plugins from the app, everything works fine is this allowed?
Not sure what you mean by that but why wouldn't it be?

I doubt many people here are familiar with purebasic tbh, but libvlc yes. Try to familiarize yourself with the docs https://videolan.videolan.me/vlc/group__libvlc.html and samples https://www.videolan.org/vlc/libvlc.html

I downloaded version 2.2.8 and then copied out the /Lib and /plugins to my project folder.

I have read the docs and now have a barebones audio player all working as I need it. This will allow other PB programmers to build their own audio players as they wish.

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: PureBasic & LibVLC

Postby mfkl » 28 Sep 2021 08:07

I downloaded version 2.2.8
It is advised you use the latest 3.x version, as the 2.x is old, unmaintained and unsecure.
https://mfkl.github.io


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 17 guests