20 Jun '13 - 09:52 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: non english symbols caption of streem  (Read 714 times)
qwerty
Posts: 6


« on: 1 Nov '11 - 17:49 »
Reply with quoteQuote

Hi!
I have a problem.
I Make a internet radio on bass.dll (Delphi XE2). It's work good, but I have a problem:
Russian symbols in the track caption are displayed by hieroglyphs
Logged
qwerty
Posts: 6


« Reply #1 on: 1 Nov '11 - 18:23 »
Reply with quoteQuote

var
  meta: PAnsiChar;
begin

  meta := BASS_ChannelGetTags(chan, BASS_TAG_ID3V2);
 showmessage(meta);
This is return meta='' (empty string)
Logged
Chris
Posts: 1507


« Reply #2 on: 1 Nov '11 - 22:44 »
Reply with quoteQuote

Hi
 should be

meta := BASS_ChannelGetTags(chan, BASS_TAG_META);
take a look in the bass netradio example
Chris



Logged
qwerty
Posts: 6


« Reply #3 on: 2 Nov '11 - 10:41 »
Reply with quoteQuote

Certainly I so at first also have made! But hieroglyphs came if the track text is named by Russian symbols. Therefore I have tried through idv3 tags and left nothing
Logged
qwerty
Posts: 6


« Reply #4 on: 2 Nov '11 - 10:49 »
Reply with quoteQuote

procedure DoMeta();
var
  meta: PAnsiChar;
  p: Integer;
begin
  meta := BASS_ChannelGetTags(chan, BASS_TAG_META);
  if (meta <> nil) then
  begin
    p := Pos('StreamTitle=', String(AnsiString(meta)));
    if (p = 0) then
      Exit;
    p := p + 13;
    SendMessage(win, WM_INFO_UPDATE, 7, DWORD(PAnsiChar(AnsiString(Copy(meta, p, Pos(';', String(meta)) - p - 1)))));
  end;
I took as an example demo for radio. Changed only one line - ADD MY url on a Russian radio station. Launched - compiled and received

Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #5 on: 2 Nov '11 - 15:26 »
Reply with quoteQuote

Shoutcast metadata (BASS_TAG_META) generally uses the ISO-8859-1 character set, which doesn't support Russian characters. For comparison, is the metadata looking correct in any other software?

If you're broadcasting the stream, and you want to include Russian characters in the metadata, perhaps you could use Icecast/OGG for it instead? That uses UTF-8 for its metadata (BASS_TAG_OGG).
Logged
qwerty
Posts: 6


« Reply #6 on: 2 Nov '11 - 15:32 »
Reply with quoteQuote

in AIMP Russian characters correctly displays the radio station and is written using bass audio library. thanks for the help I will try to use BASS_TAG_OGG.
Logged
qwerty
Posts: 6


« Reply #7 on: 2 Nov '11 - 15:42 »
Reply with quoteQuote

I'm sorry but BAS_TAG_OGG not suitable because the station is not broadcasting the tags in this format. (I am not the owner of the station). Other software correctly displays Russian characters in the title track
Logged
Ian @ un4seen
Administrator
Posts: 15366


« Reply #8 on: 2 Nov '11 - 17:18 »
Reply with quoteQuote

That's strange. From your screenshot, you appeared to be playing a stream from zaycev.fm, so I tried playing the stream from there and the title didn't seem quite right in any software that I tried (including AIMP3), but perhaps it's due to the Windows language/fonts used (English here). Looking at the stream's metadata (BASS_TAG_META) contents though, it appears to be in UTF-8 form (rather than ISO-8859-1), so you could try converting it from that to UTF-16 form for a Delphi "WideString". It looks like Delphi has a UTF8Decode function that you can use to do that.
Logged
Chris
Posts: 1507


« Reply #9 on: 4 Nov '11 - 09:34 »
Reply with quoteQuote

I think its a Shoutcast 2 Radiostation
as Shoutcast2 you will have in Shoutcast.conf the Option to change from Latin to UTF.
So as Ian wrote you must decode the string from utf to a (wide)string
Chris
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines