2.2.0 and equalizer

This forum is about all development around libVLC.
spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

2.2.0 and equalizer

Postby spider58 » 24 Apr 2014 14:18

Hello. Im using Libvlc 2.2.0 which downloaded from nightly builds.

is there any code sample for change equalizer frequency values (libvlc 2.2.0)

Im implemented DLL equalizer functions to my project but i dont know how can i change equalizer.

Thanks for relations.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: 2.2.0 and equalizer

Postby Jean-Baptiste Kempf » 24 Apr 2014 14:27

Look at the Android code.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 24 Apr 2014 14:39

Look at the Android code.
Thanks for relations. but if your mean is https://forum.videolan.org/viewforum.php?f=35 im already look here. But nothing found. :( really sorry for inconvenience

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 24 Apr 2014 14:50

Hello again. Here is part of my code

FORM SIDE
Button_click

Code: Select all

dim myeq as new equalizer player.seteq = myeq

WRAPPER SIDE FUNCTION

Code: Select all

<dllImport("libvlc",Callingconvention:=CallingConvention.Cdecl)>_ Public Shared Function libvlc_media_player_set_equalizer(Byval player as intptr, p_equalizer as intptr) End Function

Code: Select all

Public Property seteq() as Equalizer Get return nothing End Get Set (Byval value as Equalizer) libvlc.libvlc_media_player_set_equalizer(player.handle, value.handle) End Set end function

WHEN i pressed button returns error message

Pinvoke restriction: cannot return variants

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: 2.2.0 and equalizer

Postby sherington » 24 Apr 2014 15:26

There is an example in the VLC test sources:

http://git.videolan.org/?p=vlc.git;a=bl ... f4;hb=HEAD

This test code shows how to get presets, get/set individual frequency values, and enable/disable the equalizer on a media player.

Convert that to whatever language you're using.

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 24 Apr 2014 15:28

There is an example in the VLC test sources:

http://git.videolan.org/?p=vlc.git;a=bl ... f4;hb=HEAD

This test code shows how to get presets, get/set individual frequency values, and enable/disable the equalizer on a media player.

Convert that to whatever language you're using.
thank you sir. I will try now.

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 24 Apr 2014 15:46

There is an example in the VLC test sources:

http://git.videolan.org/?p=vlc.git;a=bl ... f4;hb=HEAD

This test code shows how to get presets, get/set individual frequency values, and enable/disable the equalizer on a media player.

Convert that to whatever language you're using.
hmm. cannot convert all of code. But tried somethings

preset count is returning 18 and in this code

Code: Select all

For i As UInteger = 0 To u_presets - 1 assert(Nothing IsNot libvlc_audio_equalizer_get_preset_name(i)) equalizer = libvlc_audio_equalizer_new_from_preset(i) assert(equalizer) libvlc_audio_equalizer_release(equalizer) Next i
equalizer = libvlc_audio_equalizer_new_from_preset(i)
im getting same error on this line

Pinvoke restriction: cannot return variants

what assert code mean in Vb.NET i dont know. I cant apply assert code

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 24 Apr 2014 16:08

maybe C# code is much easy than C for convert

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

Re: 2.2.0 and equalizer

Postby mangokm40 » 24 Apr 2014 19:28

equalizer = libvlc_audio_equalizer_new_from_preset(i)
im getting same error on this line

Pinvoke restriction: cannot return variants

============================================================

Hope I don't waste your time with this, but....

If you're declaration looks like this:
"Public Shared Function libvlc_media_player_set_equalizer(Byval player as intptr, p_equalizer as intptr)"

The First link that Google returns for your error message suggests you do this:
"Public Shared Function libvlc_media_player_set_equalizer(Byval player as intptr, p_equalizer as intptr) as integer"

The link is here:
http://social.msdn.microsoft.com/Forums ... sexpressvb

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 24 Apr 2014 21:45

equalizer = libvlc_audio_equalizer_new_from_preset(i)
im getting same error on this line

Pinvoke restriction: cannot return variants

============================================================

Hope I don't waste your time with this, but....

If you're declaration looks like this:
"Public Shared Function libvlc_media_player_set_equalizer(Byval player as intptr, p_equalizer as intptr)"

The First link that Google returns for your error message suggests you do this:
"Public Shared Function libvlc_media_player_set_equalizer(Byval player as intptr, p_equalizer as intptr) as integer"

The link is here:
http://social.msdn.microsoft.com/Forums ... sexpressvb
yeah thanks fo reply. im already found solution but i cannot reply here because i had no time :)

All functions must has return type. That's my mistake.

Now equalizer working good. :) thanks

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 25 Apr 2014 11:13

hello again. i know i said "problem solved" but i can't changing equalizer amplitude.

WAY 1

Code: Select all

dim eq as new equalizer eq.Bands(0).Amplitude = 2.3F eq.Bands(1).Amplitude = 3.1F . . . eq.Bands(9).Amplitude = -4.5F libvlc.libvlc_media_player_set_equalizer(Player_handle,Nothing) libvlc.libvlc_media_player_set_equalizer(Player_handle,eq)
WAY 2

Code: Select all

dim eq as new equalizer libvlc.libvlc_audio_equalizer_set_amp_at_index(eq.handle,2.3F,0) libvlc.libvlc_audio_equalizer_set_amp_at_index(eq.handle,3.1F,1) . . . libvlc.libvlc_audio_equalizer_set_amp_at_index(eq.handle,-4.5F,9) libvlc.libvlc_media_player_set_equalizer(Player_handle,Nothing) libvlc.libvlc_media_player_set_equalizer(Player_handle,eq)
Anyway amplitute values of 10 bands returns 0

what im doing wrong ?

Best regards

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 25 Apr 2014 20:15

pff. this problem is annoying me :evil:

i think all my code good.

Always all amplitudes for all bands is being 0

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 27 Apr 2014 11:27

sorry for bumping but i want to know my coding is true or not.

spider58
Blank Cone
Blank Cone
Posts: 91
Joined: 28 Jun 2011 14:39

Re: 2.2.0 and equalizer

Postby spider58 » 28 Apr 2014 16:32

Thanks for relations. problem solved. was my fault.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 34 guests