I want the use wave files

I want the use wave files

Postby HATHAL » Fri Jan 13, 2006 3: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
User avatar
HATHAL
 
Posts: 77
Joined: Tue Nov 15, 2005 3:38 pm
Location: The Kingdom Saudi Arabia -Riyadh

Re: I want the use wave files

Postby Enrico Maria Giordano » Fri Jan 13, 2006 3:33 pm

This is a sample of SndPlaySound() usage:

Code: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby HATHAL » Mon Jan 16, 2006 3: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
User avatar
HATHAL
 
Posts: 77
Joined: Tue Nov 15, 2005 3:38 pm
Location: The Kingdom Saudi Arabia -Riyadh

Postby Enrico Maria Giordano » Mon Jan 16, 2006 7:41 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Carles » Wed Mar 01, 2006 8:09 am

Hi Enrico,

Do you have implemented SndPlayResource() ?

Thanks.
C.
User avatar
Carles
 
Posts: 1137
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona

Postby Enrico Maria Giordano » Wed Mar 01, 2006 8:23 am

No, sorry.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Wed Mar 01, 2006 12:01 pm

Carles,

We have not tested it yet, but this may be the code for it:
Code: Select all  Expand view  RUN
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Salvador » Mon Jul 28, 2008 9: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
Salvador
 
Posts: 144
Joined: Sun Dec 18, 2005 3:18 pm
Location: España

Postby Antonio Linares » Tue Jul 29, 2008 12:39 am

Salvador,

Pruébala así:

Code: Select all  Expand view  RUN
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Salvador » Tue Jul 29, 2008 7: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
Salvador
 
Posts: 144
Joined: Sun Dec 18, 2005 3:18 pm
Location: España

Postby Antonio Linares » Tue Jul 29, 2008 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Tue Jul 29, 2008 10:35 am

Salvador,

Una solución temporal podría ser esta:
Code: Select all  Expand view  RUN
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Salvador » 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
Salvador
 
Posts: 144
Joined: Sun Dec 18, 2005 3:18 pm
Location: España

Postby Antonio Linares » Tue Jul 29, 2008 5:35 pm

Salvador,

Te acabo de contestar en esa conversación, gracias
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Salvador » Tue Jul 29, 2008 6:41 pm

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

not implemented yet
LockResource( )

Garcias por tu paciencia :)
Saludos
Salvador
Salvador
 
Posts: 144
Joined: Sun Dec 18, 2005 3:18 pm
Location: España

Next

Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 3 guests