comp.lang.ada
 help / color / mirror / Atom feed
* any mp3 library bindings?
@ 2018-02-08  5:23 Stephen Leake
  2018-02-08 16:41 ` Jeffrey R. Carter
  2018-02-08 16:49 ` Per Sandberg
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Leake @ 2018-02-08  5:23 UTC (permalink / raw)


I'm working on a web interface to my music library, and I need to read the meta info from each music file; ie, read the mp3 tags.

I found ffmpeg (https://ffmpeg.org/), which provides a C interface. Does anyone have Ada bindings for that, or another mp3 library?

-- Stephe

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any mp3 library bindings?
  2018-02-08  5:23 any mp3 library bindings? Stephen Leake
@ 2018-02-08 16:41 ` Jeffrey R. Carter
  2018-02-08 16:49 ` Per Sandberg
  1 sibling, 0 replies; 6+ messages in thread
From: Jeffrey R. Carter @ 2018-02-08 16:41 UTC (permalink / raw)


On 02/08/2018 06:23 AM, Stephen Leake wrote:
> I'm working on a web interface to my music library, and I need to read the meta info from each music file; ie, read the mp3 tags.
> 
> I found ffmpeg (https://ffmpeg.org/), which provides a C interface. Does anyone have Ada bindings for that, or another mp3 library?

Gnoga has an Audio_Type, child of Multimedia_Type, which can load and play MP3s. 
It has these functions to query its state:

    function Loop_Media (Media : Multimedia_Type) return Boolean;

    function Media_Duration (Media : Multimedia_Type) return Float;
    --  Returns the duration of Media in seconds.

    function Media_Source (Media : Multimedia_Type) return String;
    --  Returns the URL of the current Media

    function Media_Position (Media : Multimedia_Type) return Float;
    --  Position of Media in seconds

    function Muted (Media : Multimedia_Type) return Boolean;

    function Paused (Media : Multimedia_Type) return Boolean;

    function Playback_Ended (Media : Multimedia_Type) return Boolean;
    --  Returns true of Media position has reached end of its duration

    function Playback_Rate (Media : Multimedia_Type) return Float;
    --  Playback rate.
    --  Common values - 1.0 normal, 0.5 half speed, -1.0 reverse

    function Ready_To_Play (Media : Multimedia_Type) return Boolean;
    --  True if media is ready to be played in element

    function Seeking (Media : Multimedia_Type) return Boolean;
    --  True if user is seeking through media

    function Volume (Media : Multimedia_Type) return Volume_Range;
    --  Media volume (not system volumne) in Volume_Range

I don't know if this helps.

-- 
Jeff Carter
"Perfidious English mouse-dropping hoarders."
Monty Python & the Holy Grail
10


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any mp3 library bindings?
  2018-02-08  5:23 any mp3 library bindings? Stephen Leake
  2018-02-08 16:41 ` Jeffrey R. Carter
@ 2018-02-08 16:49 ` Per Sandberg
  2018-02-09 23:24   ` Stephen Leake
  1 sibling, 1 reply; 6+ messages in thread
From: Per Sandberg @ 2018-02-08 16:49 UTC (permalink / raw)


Well gave it some  30 minutes and ended up with a 1:1 mapping of between
Ada-specs and C-headers?

https://github.com/persan/a-ffmpeg

/P

Den 2018-02-08 kl. 06:23, skrev Stephen Leake:
> I'm working on a web interface to my music library, and I need to read the meta info from each music file; ie, read the mp3 tags.
> 
> I found ffmpeg (https://ffmpeg.org/), which provides a C interface. Does anyone have Ada bindings for that, or another mp3 library?
> 
> -- Stephe
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any mp3 library bindings?
  2018-02-08 16:49 ` Per Sandberg
@ 2018-02-09 23:24   ` Stephen Leake
  2018-02-22 23:53     ` Qunying
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Leake @ 2018-02-09 23:24 UTC (permalink / raw)


On Thursday, February 8, 2018 at 10:49:50 AM UTC-6, Per Sandberg wrote:
> Well gave it some  30 minutes and ended up with a 1:1 mapping of between
> Ada-specs and C-headers?
> 
> https://github.com/persan/a-ffmpeg

I tried writing my own subset of that, since I only need a few subprograms. It linked against the mingw32 ffmpeg libraries, but crashed at runtime, before the GNAT debugger got control.

So I wrote my own ID3 parser (http://id3.org/d3v2.3.0); much simpler, and it works!

-- Stephe

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any mp3 library bindings?
  2018-02-09 23:24   ` Stephen Leake
@ 2018-02-22 23:53     ` Qunying
  2018-02-24 14:52       ` Per Sandberg
  0 siblings, 1 reply; 6+ messages in thread
From: Qunying @ 2018-02-22 23:53 UTC (permalink / raw)


On Friday, February 9, 2018 at 3:25:40 PM UTC-8, Stephen Leake wrote:
> On Thursday, February 8, 2018 at 10:49:50 AM UTC-6, Per Sandberg wrote:
> > Well gave it some  30 minutes and ended up with a 1:1 mapping of between
> > Ada-specs and C-headers?
> > 
> > https://github.com/persan/a-ffmpeg
> 
> I tried writing my own subset of that, since I only need a few subprograms. It linked against the mingw32 ffmpeg libraries, but crashed at runtime, before the GNAT debugger got control.
> 
> So I wrote my own ID3 parser (http://id3.org/d3v2.3.0); much simpler, and it works!
> 
> -- Stephe

There is taglib that does the work for you, it is C only though.
http://taglib.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any mp3 library bindings?
  2018-02-22 23:53     ` Qunying
@ 2018-02-24 14:52       ` Per Sandberg
  0 siblings, 0 replies; 6+ messages in thread
From: Per Sandberg @ 2018-02-24 14:52 UTC (permalink / raw)




Den 2018-02-23 kl. 00:53, skrev Qunying:
> On Friday, February 9, 2018 at 3:25:40 PM UTC-8, Stephen Leake wrote:
>> On Thursday, February 8, 2018 at 10:49:50 AM UTC-6, Per Sandberg wrote:
>>> Well gave it some  30 minutes and ended up with a 1:1 mapping of between
>>> Ada-specs and C-headers?
>>>
>>> https://github.com/persan/a-ffmpeg
>>
>> I tried writing my own subset of that, since I only need a few subprograms. It linked against the mingw32 ffmpeg libraries, but crashed at runtime, before the GNAT debugger got control.
>>
>> So I wrote my own ID3 parser (http://id3.org/d3v2.3.0); much simpler, and it works!
>>
>> -- Stephe
> 
> There is taglib that does the work for you, it is C only though.
> http://taglib.org/
> 
Well i had to generate a binding to "http://taglib.org/"
And the API is Ada-style.
See:
	https://github.com/persan/a-taglib


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-24 14:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08  5:23 any mp3 library bindings? Stephen Leake
2018-02-08 16:41 ` Jeffrey R. Carter
2018-02-08 16:49 ` Per Sandberg
2018-02-09 23:24   ` Stephen Leake
2018-02-22 23:53     ` Qunying
2018-02-24 14:52       ` Per Sandberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox