Displaying 4 results from an estimated 4 matches for "get_num_comments".
2006 Mar 08
2
libflac++ reading vorbis metadata
...to read Song information (like artist,
trackname etc..). So..
I read metadata from file
FLAC::Metadata::get_streaminfo("somefile.flac", infosik);
and It's ok - no error, then I read vorbis info:
FLAC::Metadata::VorbisComment vorbis_kom(infosik);
int number_of_comments = vorbis_kom.get_num_comments();
and after that I have number_of_comments=14
when I try to read entry using get_comment method I got segfault
vorbis_kom.get_comment(number);
I was trying all numbers from 0, to 14 and it always segfaults
Is that a right way to read those informations? What I'm doing wrong?
2006 Mar 10
1
libflac++ reading vorbis metadata
...Josh Coalson wrote:
> the vorbiscomments are not in the streaminfo. you want to do:
>
> FLAC::Metadata::VorbisComment tags;
> if (FLAC::Metadata::get_tags("somefile.flac", tags)) {
> FLAC::Metadata::VorbisComment::Entry entry =
> tags->get_comment(tags->get_num_comments-1); //e.g. last tag
> // do something with it...
> }
>
> Josh
Oki, thanks it works. However I still have some questions about all the
libflac++. If this is impossible to read vorbis info from StreamInfo why there
is constructor for VorbisComment which takes StreamInfo as the only...
2004 Sep 10
3
reading vorbis comments with FLAC++?
...;s the code in question:
bool getflac (struct Song* flac, const char* path)
{
FLAC__StreamMetadata *md = FLAC__metadata_object_new (FLAC__METADATA_TYPE_STREAMINFO);
if (FLAC__metadata_get_streaminfo(path, md))
{
unsigned nc = 0, i;
FLAC::Metadata::VorbisComment vc (md);
nc = vc.get_num_comments();
for (i = 0; i <= nc; i++)
{
FLAC::Metadata::VorbisComment::Entry e;
e = vc.get_comment(i);
if (!strcmp(e.get_field_name(), "ARTIST"))
flac->artist = e.get_field_value();
else if (!strcmp(e.get_field_name(), "TITLE"))
flac...
2004 Sep 10
0
reading vorbis comments with FLAC++?
...ess with libFLAC. But now, it's the weekend, so I can mess around
> with
> this. Here's the code in question:
...
> When I run this code, I get a SEGV during get_comment because
> object_->data.vorbis_comment.comments is junk. Must I initialize it
> somewhere? Note that vc.get_num_comments returns 14, which I imagine
> is
> a correct number. The documentation isn't overly clear about how this
> works
> and it would be cooler if some basic examples could be provided.
>
> Thanks in advance for any help that can be provided. Excuse my
> ignorance! :(
it's...