IPB

Welcome Guest ( Log In | Register )

TAK DirectShow Filter, a filter to enable any DirectShow Player (i.e. WMP) to play .tak files
HorsePower73
post Sep 21 2009, 14:59
Post #1





Group: Members
Posts: 19
Joined: 14-July 09
Member No.: 71477



I hope this is the right place for this post.

I wrote a DirectShow filter for TAK, called dsfTAKSource.
You can download it here: http://home.tele2.it/LivioCavallo/

It's the first version, so please warn me of any problem.
This filter should allow any directshow player to open, decode and play .tak audio files.

Well, I hope you'll like it.

---
HorsePower73
Go to the top of the page
+Quote Post
 
Start new topic
Replies
zombiewerewolf
post Sep 21 2009, 18:03
Post #2





Group: Members
Posts: 119
Joined: 27-January 03
From: Perth, AU
Member No.: 4755



There's only one problem I encountered. It doesn't play tak files with unicode filename.
Go to the top of the page
+Quote Post
HorsePower73
post Sep 22 2009, 12:20
Post #3





Group: Members
Posts: 19
Joined: 14-July 09
Member No.: 71477



Yes, I know.
The problem here is that tac_deco_lib does not accept UNICODE filenames.

<brainstorming mode on>
I could try to work around this problem rewriting part of the filter to use tac-deco_lib streaming interface instead of file functions.
But now I'm considering rewriting my filter as a parser filter with support to IAsyncReader, in next major version.
<brainstorming mode off>

Maybe I'll work on it.
Go to the top of the page
+Quote Post
twistedddx
post Sep 22 2009, 15:45
Post #4





Group: Members
Posts: 37
Joined: 27-October 05
Member No.: 25383



QUOTE (HorsePower73 @ Sep 22 2009, 20:50) *
The problem here is that tac_deco_lib does not accept UNICODE filenames.


You can convert widechar to multibyte, I think TAK accept multibyte filenames? I never checked tongue.gif

If you use Visual Studio:
char mbMultiByteFilename[_MAX_PATH];
WideCharToMultiByte(CP_UTF8, 0, szWideCharFilename, -1, mbMultiByteFilename, _MAX_PATH, 0, 0);
tak_SSD_Create_FromFile (mbMultiByteFilename, &Options, NULL, NULL);
Go to the top of the page
+Quote Post
HorsePower73
post Sep 23 2009, 00:54
Post #5





Group: Members
Posts: 19
Joined: 14-July 09
Member No.: 71477



[Are these programming details in topic?]

<Programming details START>

WideCharToMultiByte is a system function accessible using Kernel32.lib starting from WinNT, it's not a VisualStudio exclusive.
Filename string conversion in dsfTAKSource is already done using WideCharToMultiByte.
Some unicode characters does not have any MB equivalent (this is a reason unicode exists!), so conversion is sometimes impossible.
Also using best_fit_conversion on conversion exception (with system default character, the '?' wilcard used in place of not convertible characters) tak_SSD_Create_FromFile cannot open the file.
<Programming details END>

I compiled a new dsfTAKSource build which returns a better error code on filename conversion error.
Now players should detect and report it in a better way.
I'll put last build on dsfTAKSource site.

P.S.: as some of you may have noticed, site has moved. Now it is here:
http://liviocavallo.altervista.org/
Go to the top of the page
+Quote Post
twistedddx
post Sep 27 2009, 14:47
Post #6





Group: Members
Posts: 37
Joined: 27-October 05
Member No.: 25383



QUOTE (HorsePower73 @ Sep 23 2009, 09:24) *
Some unicode characters does not have any MB equivalent (this is a reason unicode exists!), so conversion is sometimes impossible.


I thought UTF8 was full unicode for the sake of what people call "unicode" and is multibyte. What Chars dont convert? Widechar is just less efficient storage, handy that the char size is a constant but it offers no extra support over multibyte(UTF8). Normally problems only arise when the codepage non widechar things were encoded in is unknown and it has to be guessed.

Maybe TAK just doesnt support multibyte correctly? You really dont need widechar to support unicode!(more obvious when you realize widechar is really a Microsoft thing only, most everything else uses UTF8)

This post has been edited by twistedddx: Sep 27 2009, 14:58
Go to the top of the page
+Quote Post
HorsePower73
post Sep 27 2009, 23:14
Post #7





Group: Members
Posts: 19
Joined: 14-July 09
Member No.: 71477



First: Tks for commenting.

<short answer begin>
YES, maybe you are right: I think tak_deco_lib doesnt support multibyte correctly; and
almost NO, maybe you are wrong: I think tak_deco_lib doesnt support multibyte at all.
<short answer end>

I naturally agree with you about MBCS, UNICODE and UTF-8 relationships. I agree with this too: it's a problem guessing code pages from unicode, and moreover I doubt that even so it would work due to FS implications.
It seems easier using tak_SSD_Create_FromStream.

Just note:
CODE
char fileName [MAX_PATH];
const wchar_t wFilename[] = L"C:\\TestFile_\x0107.tak";  // N.B.: \x0171 is 'ć'
WideCharToMultiByte(CP_UTF8, 0, wFilename, -1, fileName, MAX_PATH, 0, 0);

fileName will be "C:\TestFile_ć.tak", shown as char string, not MB, where '' is 0xc4 and '' is 0x87.

Using above code you'll get the right MB string, but passing it to tak_SSD_Create_FromFile you'll get an invalid stream decoder.
As tak docs say and as tak behaves, it really seems TAK wants a simple char (not MB) string.
Naturally using CP_ACP (current system Windows ANSI code page) does not help; on my system (Italy) it converts 'ć' to 'c' and tak_SSD_Create_FromFile won't find the file.
You can play with WC_NO_BEST_FIT_CHARS flag (leading to this substitution 'ć' -> '?') but tak_SSD_Create_FromFile refuses to open.


This post has been edited by HorsePower73: Sep 27 2009, 23:33
Go to the top of the page
+Quote Post

Posts in this topic
- HorsePower73   TAK DirectShow Filter   Sep 21 2009, 14:59
- - Destroid   On installation I get the error message:CODERegSvr...   Sep 21 2009, 15:35
|- - HorsePower73   Thanks for testing the filter. effectively it is b...   Sep 21 2009, 17:22
- - Destroid   Nice! Works without those .DLL's. (I can...   Sep 21 2009, 17:49
|- - HorsePower73   Well, really that FLT filter is ready and working:...   Sep 21 2009, 18:01
|- - Destroid   QUOTE (HorsePower73 @ Sep 21 2009, 17:01)...   Sep 21 2009, 22:19
- - zombiewerewolf   There's only one problem I encountered. It doe...   Sep 21 2009, 18:03
|- - HorsePower73   Yes, I know. The problem here is that tac_deco_lib...   Sep 22 2009, 12:20
|- - twistedddx   QUOTE (HorsePower73 @ Sep 22 2009, 20:50)...   Sep 22 2009, 15:45
|- - HorsePower73   [Are these programming details in topic?] <Pro...   Sep 23 2009, 00:54
|- - twistedddx   QUOTE (HorsePower73 @ Sep 23 2009, 09:24)...   Sep 27 2009, 14:47
|- - HorsePower73   First: Tks for commenting. <short answer begin...   Sep 27 2009, 23:14
- - TBeck   QUOTE (HorsePower73 @ Sep 21 2009, 15:59)...   Sep 23 2009, 22:32
- - Zarggg   Ah, was that the problem? I'll be so happy onc...   Sep 24 2009, 16:08
|- - HorsePower73   dsfTAKSource v 0.0.1.2 is out (http://liviocavallo...   Sep 25 2009, 16:35
- - HorsePower73   Code has been updated (http://liviocavallo.altervi...   Sep 26 2009, 15:42
- - zombiewerewolf   It works great Thank you very much for adding uni...   Sep 26 2009, 17:18
- - johnsonlam   Thanks HorsePower73, though I didn't convert a...   Oct 1 2009, 15:55
- - watercolor   Can I use this on Windows 7 x64? I try Install.bat...   May 2 2010, 08:27
|- - HorsePower73   As lvqcl already said, it should work running inst...   May 2 2010, 11:17
- - lvqcl   Run 32-bit command line and type Install.bat there...   May 2 2010, 09:47
- - watercolor   QUOTE (lvqcl @ May 2 2010, 17:47) Run 32-...   May 2 2010, 12:55
- - Spiridon   TAK Sampling rate: 96Khz Resolution: 24bits Inco...   May 10 2010, 20:53
|- - HorsePower73   Thanks for signaling. Now ver 0.0.1.5 is online, f...   May 11 2010, 10:25
|- - Spiridon   QUOTE (HorsePower73 @ May 11 2010, 12:25)...   May 11 2010, 23:26
- - Spiridon   Sample rate: 192 Khz Can't start playback.   May 12 2010, 10:56
|- - HorsePower73   Well. this seems a deeper (or wider) problem. It d...   May 15 2010, 11:12
|- - Spiridon   QUOTE (Spiridon @ May 12 2010, 12:56) Sam...   May 25 2010, 14:19
- - betaking   To:HorsePower73 TAK 2.1.0 Final is out,but I found...   Mar 7 2011, 13:57
- - Destroid   I'm not sure any format changes occurred betwe...   Mar 7 2011, 22:18
|- - HorsePower73   Yes Destroid, you are right. I'm busy, but I...   Mar 18 2011, 09:39
- - HorsePower73   TAK DirectShow filter has been updated. Now it...   Dec 1 2011, 12:34
- - Nowings69   I want to ask you one why dont you make a splitter...   Dec 1 2011, 14:18
|- - HorsePower73   I think I have not understood you question. I coul...   Dec 2 2011, 00:06
- - Destroid   I had error using install.bat with registry entry ...   May 20 2012, 21:26
- - TBeck   Better late than never... Thank you for the fi...   Jun 18 2013, 08:47


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th April 2014 - 17:57