IonicWind Software

Creative Basic => General Questions => Topic started by: Egil on August 17, 2019, 05:03:49 am

Title: Filenames including space characters are ignored - why?
Post by: Egil on August 17, 2019, 05:03:49 am
After a long break, I finally started coding again, and immediately ran into a mystery (at least for me!!).
Been working on a SWLlogbook program, and thought that it would be nice to have audio record/play possibilites included.

The program is now working, but still needs a lot of work before I can call it a proper program. And that is where the mystery came in. When trying to save captured audio using a file name with a space character included, the program won't save the file.
E.g. "Blue Hawaii" does not save but "Blue_Hawaii" does save. The same when trying to play such a file. If there is a space character included in the filename, the program ignores it.

Does anyone know how to work around this strange behaviour??

Almost forgot to tell: using "WINMM" for the audio parts.


Regards,
Egil.
Title: Re: Filenames including space characters are ignored - why?
Post by: aurelCB on August 17, 2019, 12:23:50 pm
Hi Egil
I am not sure but might be trick with chr$(34) like :

chr$(34) + filename_with_space_char + chr$(34)

do you can try that?
Title: Re: Filenames including space characters are ignored - why?
Post by: Egil on August 17, 2019, 01:18:35 pm
Hi Zlatko,

I did a couple of searches on the web, and found that putting spaces in filenames generates problems.
Many suggested solutions similar to yours, but none of them worked neither did yours.
So instead of doing a lot of work, maybe in vain, I decided to use underscores instead of spaces to make the filenames more readable.

Right now I record files with names such as:  "6085_20190817_1733.wav", which means that the recording was made of a transmission on 6085 kHz at UTC date and time.(today at 1733 UTC).

I choose to use "Winmm" since this makes it easy to play booth WAV amd MP3 files. So the next obvious step will be to convert the WAV recordings to MP3 using the LAME audio library. I have never done that before, so reckon I have lot to learn.

Thanks for trying anyway.


Regards,
Egil


PS
I have a very crude, working version of the recorder/player for CB, but there are still many details to do before the program is complete. But in case anyone wants to play around with the finished code, I'll post what I already have.

Title: Re: Filenames including space characters are ignored - why?
Post by: Rock Ridge Farm (Larry) on August 17, 2019, 02:32:02 pm
Command line processors use space/tab as a separator. It is how they break up arguments.

Larry
Title: Re: Filenames including space characters are ignored - why?
Post by: Egil on August 18, 2019, 01:02:47 am
Thanks Larry!

Becoming rather rusty here, shuld have thought about that myself...


Egil