FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC I want the use wave files
Posts: 80
Joined: Tue Nov 15, 2005 03:38 PM
I want the use wave files
Posted: Fri Jan 13, 2006 03:25 PM

To all
I want the use wave files
From ( evc & borland c ) language
For work
Text-To-Speech for arabic language
i testing with funtion " playsound() "
She has tried with sources, but I did not succeed
And he happens dedication to the sound with the succession of the words

regards
hathal

:(

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: I want the use wave files
Posted: Fri Jan 13, 2006 03:33 PM
This is a sample of SndPlaySound() usage:

#include "Fwce.ch"


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    @ 1, 1 BUTTON "Play";
           SIZE 60, 30;
           ACTION SNDPLAYSOUND( CURDIR() + "\TEST.WAV" )

    ACTIVATE WINDOW oWnd

    RETURN NIL


#pragma BEGINDUMP

#include "windows.h"
#include "mmsystem.h"
#include "hbapi.h"


LPWSTR AnsiToWide( LPSTR );


HB_FUNC( SNDPLAYSOUND )
{
    LPWSTR pW = AnsiToWide( hb_parc( 1 ) );
    hb_retnl( sndPlaySound( pW, hb_parni( 2 ) ) );
    hb_xfree( pW );
}

#pragma ENDDUMP


EMG
Posts: 80
Joined: Tue Nov 15, 2005 03:38 PM
I want the use wave files
Posted: Mon Jan 16, 2006 03:28 AM

thank you EMG
She has pulled that but cutting off of the sound happens
I want function that reads the file from specific place and it ends in specific place
regards
hathal

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
I want the use wave files
Posted: Mon Jan 16, 2006 07:41 AM

You may try using MCI but I don't know if it is implemented in WinCE and how.

EMG

Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
I want the use wave files
Posted: Wed Mar 01, 2006 08:09 AM

Hi Enrico,

Do you have implemented SndPlayResource() ?

Thanks.
C.

Salutacions, saludos, regards

"...programar es f谩cil, hacer programas es dif铆cil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
I want the use wave files
Posted: Wed Mar 01, 2006 12:01 PM
Carles,

We have not tested it yet, but this may be the code for it:
HB_FUNC( SNDPLAYRESOURCE )
{
   LPWSTR pW1   = AnsiToWide( IF( ISNUM( 1 ), ( LPSTR ) hb_parnl( 1 ), hb_parc( 1 ) ) );
   LPWSTR pW2   = AnsiToWide( "WAVE" );	
   LPWSTR pW3;
   HGLOBAL hglb = LoadResource( GetResources(),
                     FindResource( GetResources(), pW1, pW2 ) );
        
   pW3 = AnsiToWide( ( LPSTR ) LockResource( hglb ) );  
   hb_retl( sndPlaySound( pW3, IF( PCOUNT() > 1, hb_parni( 2 ), SND_ASYNC ) | SND_MEMORY | SND_NODEFAULT ) );
   hb_xfree( pW1 );
   hb_xfree( pW2 );
   hb_xfree( pW3 );                     
  
   UnlockResource( hglb );
   FreeResource( hglb );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 144
Joined: Sun Dec 18, 2005 03:18 PM
I want the use wave files
Posted: Mon Jul 28, 2008 09:12 PM

Antonio he probado SndPlayResource en mi aplicaci贸n pero genera estos errores:

--------------------Configuraci贸n: gestion - Debug--------------------
c:\propis\gestion\debug\suenawav.c(116) : warning C4129: 'p' : unrecognized character escape sequence
c:\propis\gestion\debug\suenawav.c(116) : warning C4129: 'G' : unrecognized character escape sequence
c:\propis\gestion\debug\suenawav.c(116) : warning C4129: 'S' : unrecognized character escape sequence
C:propisGestionSuenawav.prg(76) : warning C4013: 'IF' undefined; assuming extern returning int
C:propisGestionSuenawav.prg(76) : warning C4047: 'function' : 'char ' differs in levels of indirection from 'int '
C:propisGestionSuenawav.prg(76) : warning C4024: 'AnsiToWide' : different types for formal and actual parameter 1
C:propisGestionSuenawav.prg(79) : warning C4013: 'GetResources' undefined; assuming extern returning int
C:propisGestionSuenawav.prg(79) : warning C4047: 'function' : 'struct HINSTANCE__
' differs in levels of indirection from 'int '
C:propisGestionSuenawav.prg(79) : warning C4024: 'LoadResource' : different types for formal and actual parameter 1
C:propisGestionSuenawav.prg(80) : warning C4047: 'function' : 'struct HINSTANCE__ *' differs in levels of indirection from 'int '
C:propisGestionSuenawav.prg(80) : warning C4024: 'FindResourceW' : different types for formal and actual parameter 1
C:propisGestionSuenawav.prg(83) : warning C4013: 'PCOUNT' undefined; assuming extern returning int
C:propisGestionSuenawav.prg(88) : warning C4013: 'UnlockResource' undefined; assuming extern returning int
C:propisGestionSuenawav.prg(89) : warning C4013: 'FreeResource' undefined; assuming extern returning int
Creating library Gestion.lib and object Gestion.exp
Suenawav.obj : error LNK2019: unresolved external symbol FreeResource referenced in function HB_FUN_SNDPLAYRESOURCE
Suenawav.obj : error LNK2019: unresolved external symbol UnlockResource referenced in function HB_FUN_SNDPLAYRESOURCE
Suenawav.obj : error LNK2019: unresolved external symbol PCOUNT referenced in function HB_FUN_SNDPLAYRESOURCE
Suenawav.obj : error LNK2019: unresolved external symbol IF referenced in function HB_FUN_SNDPLAYRESOURCE

Creo que me falta algun fichero en el enlace, pero no se cual.

Gracias por adelantado.

Saludos

Salvador
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
I want the use wave files
Posted: Tue Jul 29, 2008 12:39 AM
Salvador,

Pru茅bala as铆:

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

LPWSTR AnsiToWide( char * );
HMODULE GetResources( void );

HB_FUNC( SNDPLAYRESOURCE ) 
{ 
   LPWSTR pW1   = AnsiToWide( ISNUM( 1 ) ? ( LPSTR ) hb_parnl( 1 ) : hb_parc( 1 ) ); 
   LPWSTR pW2   = AnsiToWide( "WAVE" );    
   LPWSTR pW3; 
   HGLOBAL hglb = LoadResource( GetResources(), 
                     FindResource( GetResources(), pW1, pW2 ) ); 
        
   pW3 = AnsiToWide( ( LPSTR ) LockResource( hglb ) );  
   hb_retl( sndPlaySound( pW3, ( ( hb_pcount() > 1 ) ? hb_parni( 2 ) : SND_ASYNC ) | SND_MEMORY | SND_NODEFAULT ) ); 
   hb_xfree( pW1 ); 
   hb_xfree( pW2 ); 
   hb_xfree( pW3 );                      
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 144
Joined: Sun Dec 18, 2005 03:18 PM
I want the use wave files
Posted: Tue Jul 29, 2008 07:59 AM

Sigue dando estos errores:

Suenawav.obj : error LNK2019: unresolved external symbol "struct HINSTANCE__ * cdecl GetResources(void)" (?GetResources@@YAPAUHINSTANCE@@XZ) referenced in function HB_FUN_SNDPLAYRESOURCE
Suenawav.obj : error LNK2019: unresolved external symbol "unsigned short * __cdecl AnsiToWide(char *)" (?AnsiToWide@@YAPAGPAD@Z) referenced in function HB_FUN_SNDPLAYRESOURCE

Saludos

Salvador
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
I want the use wave files
Posted: Tue Jul 29, 2008 09:35 AM

Salvador,

Estas compilando en modo C++, de ah铆 esos errores. Revisa si usas el flag -Tp al llamar a clarm.exe

De todas formas, eso significar铆a que est谩s usando la versi贸n inicial de FWPPC, que usaba el modo C++. Ser铆a conveniente que te planteases actualizarte a la versi贸n actual que no usa el modo C++, adem谩s de incorporar muchas ventajas sobre la versi贸n que usas.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
I want the use wave files
Posted: Tue Jul 29, 2008 10:35 AM
Salvador,

Una soluci贸n temporal podr铆a ser esta:
#include <windows.h>

extern "C"
{
   HINSTANCE GetResources( void );
   unsigned short * AnsiToWide( char * );
}; 

HINSTANCE GetResources( void )
{
   return ::GetResources();
}

unsigned short * AnsiToWide( char * p )
{
   return ::AnsiToWide( p );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 144
Joined: Sun Dec 18, 2005 03:18 PM
I want the use wave files
Posted: Tue Jul 29, 2008 11:00 AM

Mi versi贸n es:
FWPPC 13/September/2007

Si usaba -TP, ahora no da error.
Gracias.

Sobre mi post:

http://www.fivetechsoft.com/forums/view ... hp?t=12018

Tienes alguna sugerencia. Es importante utilizar botones en esa aplicaci贸n.

Gracias de nuevo.

Saludos

Salvador
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
I want the use wave files
Posted: Tue Jul 29, 2008 05:35 PM

Salvador,

Te acabo de contestar en esa conversaci贸n, gracias

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 144
Joined: Sun Dec 18, 2005 03:18 PM
I want the use wave files
Posted: Tue Jul 29, 2008 06:41 PM

En cuanto a SNDPLAYRESOURCE la aplicaci贸n me genera este error:

not implemented yet
LockResource( )

Garcias por tu paciencia :)

Saludos

Salvador